|
SergejSuperstock
2016-04-22 15:58:42
|
|
Dear Quantshare,
as I am using quite complex custom indicators, my screens take quite a long time to calculate. I then found out, that by modifying my indicator I can get a massive speedup: In the indicator, instead of calculating the values for the whole "result-array", I just calculate the value for the current bar (same as the bar that my screener is looking at).
To be able to screen at past bars, I calcultate the current bars difference from the total of bars. This number is then transfered from the screener to the indicator as a static parameter.
currentbar = TotalBars() - Count() - 1;
AddColumn('CurrentBar', currentbar); // Screening on a past date, currentbar returns 30 in the screener
AddColumn('myIndicator', myIndicator(30)); // Indicator is just calculating result[cFunctions.Close.Length - 30]
So far so good. Now I want to use this method in the simulator. So I need to change my static indicator-parameter to a dynamic one, containing the date or bar number the simulator is currently looking at. Is this possible?
|
|