Hi,

You can look at unselecting the "allow same bar exit" option from the AA 
Settings window.

Otherwise:

In the example given, it is impossible to receive both a buy and sell signal on 
the same bar since the two conditions are mutually exclusive (i.e. Close cannot 
be both greater than A and less than A).

However, you have set your sell trade delay to 1 bar. That means that a sell 
signal recognized yesterday will only be acted on today. If today also 
recognized a buy signal (with zero delay), then you would end up with both a 
buy action and a sell action on the same bar (note I said action, not signal).

So, you may want to set your trade delays to all zeros in order to act on the 
signal the same day that you receive them. If adopting this approach, please be 
aware that in live trading you can never know what the Close was until it is 
already history, thus your strategy may be looking into the future.

If you want to trade the Close on the same bar that it ocurred, you may need to 
use conditional orders in your live trading such that you have calculated in 
advance what the close price must be in order for your indicators to give the 
value necessary to trigger the buy on close event.

Mike

--- In [email protected], "Mike Mann" <m...@...> wrote:
>
> I've been testing systems that have trade entry at the close of day zero and 
> exit on the close of day one.  Any of these systems work fine with the 
> exception of single day trades or the first day of multiday trade.  On those 
> days, the system exits on day zero (the entry day) instead of day one and 
> there is no trade that day.  Sample AFL for a simple moving average system is 
> shown below.  I know that I'm probably overlooking something simple in the 
> settings or ??  Thanks for your help.
> 
> A=MA(C,200);
> 
> Plot(A,"MA200",colorBrightGreen,1);
> 
> SetTradeDelays(0,1,0,1);
> 
> //Backtester Set to Trade the close for buy, sell, short, cover.
> 
> Buy=C>A;
> Sell=C<A;
>


Reply via email to