I use the Portfolio Trader to load, say 100 symbols. Different symbols contain different number of bars. If the symbol has >= 250 bars, the highest high of the recent 250 bars is obtained. If the symbol has < 250 bars, the highest high of all the bars is obtained.
The code is shown below.
Code: Select all
if LastBarOnChart then
begin
if BarNumber >= 250 then
high_250d = highest(high, 250)
else
high_250d = highest(high, BarNumber);
end;
I know maxbarsback cannot be changed at runtime by code, so any other means to achieve what I want to do?
Thanks in advance.