Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 10:17:57 +0000



Post From: AutoTrade Bar Based BackTest - incorrect behavior

[2018-10-04 08:31:23]
Rearden - Posts: 16
Thank you for your answer. Please let me assure you that I really don't want to waste your time unnecessarily - I have already been autotrading live for a couple of months and intraday backtesting / autotrading works perfectly.

Please see enclosed image which shows that There is Buy Entry study and that there are short positions created. Also please see further comment which might explain what we are seeing on the picture (although I still consider it invalid behaviour).

You can't see details of Buy Exit study on the picture but I later deleted it and it had no effect.

Regarding attached orders - I do use GTC TIF for both target and stop-loss, it can also be seen on the image.

I think that it is actually the attached orders that create the short positions. Trade activity log shows that the short positions were entered by a stop order (not a market order). When I change PT and SL to unreachable numbers, the backtest creates a long position. However - not on the date of the buy signal but on current day (on the last daily bar of the chart).

Therefore, I can see two related issues here (only when running bar based backtest on historical chart; not when running it on intraday chart):
- a market order with a positive quantity is created on the last bar of the chart (while it should be created on the signal bar)
- attached order with a negative quantity creates a short position (while it should just flatten a long position, if it existed)

imageBuy entry signal creates a short positions.jpg / V - Attached On 2018-10-04 08:28:51 UTC - Size: 599.5 KB - 275 views