Hi dwrowley,
 
The code looks useful.
Can you incorporate it into following requirement,if possible?
 
 
Please help by providing code lines for following condition
If the histogram lines of MACD are above zero line, and if the histogram line 
value rises up by say,2%, within a limited timespan of say 5 bars,then buy 
signal shows up.
In case the rise of macd histogram line magnitude is not upto the required 
level, it gives NO TRADE signal.
similarly a sellshort sinal is to indicated when
the histogram line is below zero line, and drops in value more than x %
in a span of 5 bars,to validate sell signal.
sell signal appears.
if required move on downside has not occurred, then No trade signal occurs or 
nothing happens.
Appreciate your help
regards with advance thanks,
rv

--- On Mon, 6/21/10, dwrowley_2000 <dwrow...@mail.com> wrote:


From: dwrowley_2000 <dwrow...@mail.com>
Subject: [amibroker] Re: afl coding required -- 2
To: amibroker@yahoogroups.com
Date: Monday, June 21, 2010, 6:32 PM


  




If you want two bars of positive signal before you enter a trade, you can do 
something like:

PrelimBuy = <condition>

Buy = PrelimBuy AND Ref(PrelimBuy,-1)

This will only initiate a BUY if PrelimBuy is true for two consecutive bars

D.

--- In amibroker@yahoogroups.com, "prasantaroy36" <prasantaro...@...> wrote:
>
> 
> 
> --- In amibroker@yahoogroups.com, "prasantaroy36" <prasantaroy36@> wrote:
> >
> > Dear friends
> > 
> > After fulfill buy & short condition, trade will be done after 2nd bar 
> > closing price from signal bar if valid still signal generated condition. 
> > So, what will be the afl logic for backtesting purpose?
> > Pl,guide.
> > 
> > Thanks
> >
> 
> 
> 
> Pl, help
>









      

Reply via email to