[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Two easy questions



PureBytes Links

Trading Reference Links

Hi Blair,

Thanks for your response! 

For Problem 1, Mike gave me a simplier solution and it works fine.

For Problem 2, I used your code.  Here is what I wrote:

achat=Buying condition (e.g.  C>Ma (c,20);
arsignal = IIf(achat, 1,0);
arnotrade = IIf(HHV(arsignal,5)==1, 1, 0);
if (arnotrade=1)
{

//Sell =C< Ref (LLV (C,1),-1);
Sell=0;
//don't ACT on Buy/Sell Signals
// probably still want to calculate them
}
else
{

Sell =C< Ref (LLV (C,1),-1);
// code here for ACTING on your Buy/Sell signals
}

I used lowest value of 1 day only to test, but unfortuntately it does not work...  Should have an easiest way?!

Thanks!

Louis



2008/7/30 Blair <snoopy.pa30@xxxxxxxxx>

Louis,

I am new to AB, but hopefully this can help out...

First:
Create an array for the period that you want to plotshapes.
Have your code assign the value to the array.
Have your code check for the value using ref(arrayname,-1).

Sample code:
arplot = iif(somecondition,1,0);
plotcondition = ref(arplot,-1);
if (plotcondition==1)
plotshape(....).;

Second:
Similar to above, use an array and check if you have a signal within
last x(5) periods.

Sample code:
arsignal = iif(yourbuyorsellsignalcondition, 1,0);
arnotrade = iif(HHV(arsignal,5)==1, 1, 0);
if (arnotrade==1)
{
//don't ACT on Buy/Sell Signals
// probably still want to calculate them
}
else
{
// code here for ACTING on your Buy/Sell signals
}

I hope this is helpful for you.

Blair



--- In amibroker@xxxxxxxxxxxxxxx, "Louis P." <rockprog80@xxx> wrote:
>
> Hi,
>
> I have* two* easy questions, if anyone can help me.
>
> *First*, I'd like to draw plotshapes not on the period the signal
was issued
> but on the period after the signal was issued. How can that be done?
>
> *Then*, (I asked this question already on the web site of the group,
but for
> some reason I didn't receive it in my mailbox so maybe there is a
problem.
> If you already received this question, please discard this one), I
wonder
> how to create a no-trade zone:
>
> I know how to do an automatic "sell after X period":
>
> Buy = c>ma (c,20);
> Buy = Exremspan (Buy,5);
> Sell = Ref (Buy,-5);
>
> I'd like to set a trade system that would begin to look for signals
AFTER
> that "no-trade" zone.
>
> E.g. In the example above, I'd like the system to do nothing for the
first 5
> bars after my entry and then, and only then, check for an exit
signal. How
> would you do that?
>
> Thanks a lot, and sorry if you received question 2 twice!
> Louis
>


__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___