Support Board
Date/Time: Mon, 20 May 2024 17:32:46 +0000
Post From: regarding back testing
[2019-05-20 10:05:32] |
User479048 - Posts: 19 |
In my strategy , we fire entry or exit for each bar ,based on entry and exit conditions We check current position (0/1) by sc.GetTradePosition() function as below code: Quantity =0,position =0 int PositionDataResult = sc.GetTradePosition(PositionData); if (PositionDataResult > 0) { Quantity = PositionData.PositionQuantity;//Access the quantity if (Quantity > 0) { position = Quantity; } } if position and quantity both are 0 then we fire entry order and if they are > 0 we fire exit order. i.e. it goes like, BUY then SELL then BUY then SELL.... While doing backtesting by adding multiple symbols in watch list : for few symbols(for eg: DGLD 60min chart) it goes like, BUY then BUY then BUY while if we perform backtest on that particular symbol(DGLD 60min chart) alone it goes fine i.e. BUY then SELL then BUY then SELL.... Dont knjow why at times it goes like BUY BUY BUY or SELL SELL SELL. it should be always BUY SELL BUY SELL i have attached the screenshots for the same |
buybuybuy.png / V - Attached On 2019-05-20 10:03:45 UTC - Size: 177.32 KB - 261 views buysellbuysell.png / V - Attached On 2019-05-20 10:03:54 UTC - Size: 116.87 KB - 247 views sellsellsell.png / V - Attached On 2019-05-20 10:04:59 UTC - Size: 101.46 KB - 261 views |