I have installed MultiCharts Version 8.7 Release (Build 7408)
To understand Barstatus behavior I took a chart with data1(1min) and data2(5min).
Then I inserted this code and looked the output.
Code: Select all
[IntrabarOrderGeneration=True];
once cleardebug;
vars:
intrabarpersist iClose1(0),
intrabarpersist iClose2(0),
recalcpersist rClose1(0),
recalcpersist rClose2(0);
iClose1=Close of data1;
iClose2=Close of data2;
rClose1=Close of data1;
rClose2=Close of data2;
print (time_s:0:0," : ",iClose1:0:3," ",iClose2:0:3," ",rClose1:0:3," ",rClose2:0:3," ",barstatus(1):0:0," - ",barstatus(2):0:0);
...
140900 : 3.554 3.544 3.554 3.544 1 - -1
140900 : 3.554 3.544 3.554 3.544 1 - -1
140900 : 3.554 3.544 3.554 3.544 1 - -1
140900 : 3.554 3.544 3.554 3.544 1 - -1
140900 : 3.552 3.544 3.552 3.544 1 - -1
140900 : 3.552 3.544 3.552 3.544 1 - -1
140900 : 3.552 3.544 3.552 3.544 1 - -1
140900 : 3.552 3.544 3.552 3.544 1 - -1
140900 : 3.552 3.544 3.552 3.544 2 - -1
141000 : 3.552 3.546 3.552 3.546 0 - 0
141000 : 3.552 3.546 3.552 3.546 1 - 1
141000 : 3.552 3.546 3.552 3.546 1 - 1
141000 : 3.552 3.546 3.552 3.546 1 - 1
141000 : 3.552 3.546 3.552 3.546 1 - 1
141000 : 3.552 3.546 3.552 3.546 1 - 1
141000 : 3.552 3.546 3.552 3.546 1 - 1
141000 : 3.552 3.546 3.552 3.546 1 - 1
....
What I can see is that for data1(1min) on every tick I have the expected result:
0- first tick of the bar
1- intrabar tick
2- last tick of the bar
On the contrary for data2(5min) I have the expected results only every 5 minutes (140000,140500,141000 ...), while for 4 minutes (i.e. 140600,140700,140800,140900)
I have always barstatus(2)=-1.
Why ?
Any explanation would be greatly appreciated.
Massimo