I just finished my indicator, and inside i have a code, which has to run ONLY on RealTime data NOT on Historical. When i test, only the indicator - works fine. The problem appear when i try to use the indicator from inside a strategy. Then the State return all the time that the data are RealTime even for the first bar which is a few day earlier. I tested the effect with a very simple custom made indicator, and as soon i use it from a strategy the result for State is RealTime All the time for each bar. Is that a bug in NT8, or...The code is very simple:
Indicator:
public class MyCustomIndicator : Indicator
{
protected override void OnBarUpdate()
{
//Add your custom indicator logic here.
if (State != State.Historical)
Print("This is NOT Historical Data Bar N: "+ CurrentBar);
else
Print("This is Historical Data Bar N: " + CurrentBar);
}
......................................
The strategy cod:
}
else if (State == State.Configure)
{
AddChartIndicator(MyCustomIndicator());
}
When I apply only the Indicator to the chart everything is OK, When i call the Indicator from the strategy.....All the bars appear to be in RealTime State!!!!!!
Please help.
Thank You.
Comment