[amibroker] Re: EOD and Backtesting

 

Without seeing your AFL theirs probably some bad logic with Buy/Sell and also be aware of your buyprice/sellprice logic if using it.

Long only will allow Buy/Sell. Amibroker uses Short/Cover for going short so it's not the long only option.

Using allowsamebarexit can cause some issues when not looking intra bar to see which condition happened first, your Buy signal or Sell signal.

I'm assuming the bad trades happen on one bar trades?

Depending on the system and conditions used, some information may not be available until the close of the bar like a moving average volume for example.

Dumby example would be saying buying at the high of that bar or the low of that bar, one doesn't know the high or low until the bar has closed.

An example of a same day system that would be logical would be

Buy = Open > ref(C,-1); // open greater then yesterday's close
Sell = Close; // sell at close

Buyprice = Open;
SellPrice = Close;

The buyprice and sell price can also be set in the settings tab under trades

Just remember to work the logic and make sure what your doing is possible with same bar exit strategies. Also understanding the settings, buyprice/sellprice and also look in the manual at "SetTradeDelays(0,0,0,0)" which is another useful took in making sure your system runs in the right way.



---In amibroker@yahoogroups.com, <coblehill@...> wrote :

Hi
I was just trying some simple code on EOD data with settings in the long only position and noticed that because I also have same bar exit that some buys and sells on the same day are read in the backtester in the wrong order. That is, the code sells before it buys but accounts for it in the backtester.as a normal trade. Does anyone know how to deal with this?
Thanks for your help
norm

__._,_.___

Posted by: brandon.richard03@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)
**** 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/


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv