by dogxyz » Fri Oct 07, 2016 12:16 pm
When I use this SuperTrend Indicator Strategy for backtest in MarketScope of TS II, I can't get the correct indicator data. Please see my attached figure. I add the following debug messages in the end of ExtUpdate():
core.host:trace("update "..GetDateTime().." period="..period);
core.host:trace(" open= "..Source.open[period].." close= "..Source.close[period].." high= "..Source.high[period].." low= "..Source.low[period]);
core.host:trace(" SUPERTREND= "..Indicator.DATA[period]);
if Indicator.DATA:colorI(period)== core.rgb(0, 255, 0) then
core.host:trace(" SUPERTREND is green (UP)\n");
elseif Indicator.DATA:colorI(period)== core.rgb(255, 0, 0) then
core.host:trace(" SUPERTREND is red (DN)\n");
end
At the beginning, it is ok to get SuperTrend indicator data and color. After the first trend change about 2016/2/22 03:15, it fails to get the correct indicator data and color.
This problem only happens when I use Backtest with SuperTrend strategy. It is ok if run in real time. Is there anybody could help me? Thanks.
- Attachments
-
- Backtest log