PureBytes Links
Trading Reference Links
|
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 amibroker@xxxxxxxxxxxxxxx, "Mike Mann" <m3m@xxx> 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;
>
------------------------------------
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|