Code: Select all
variables: tvAverage(0), vAverage(0), vBar(0), MeaningfulVolume(91), mDay(1);
for value1 = 1 to 3
begin
if currentbar = value1 then
begin
value2 = Ticks + value2;
print("Ticks: ", Ticks, ", Total volume: ", value2, ", Time: ", Time);
end;
end;
if currentbar > 20 then
begin
if month(date) <> month(date[1]) then
begin
//vmAverage[0] = 0;
tvAverage = 0;
mDay = 0;
end;
end;
Ticks: 71.00, Total volume: 71.00, Time: 946.00
Ticks: 69.00, Total volume: 140.00, Time: 947.00
Ticks: 76.00, Total volume: 216.00, Time: 948.00
Ticks: 13.00, Total volume: 13.00, Time: 952.00
Ticks: 36.00, Total volume: 49.00, Time: 953.00
Ticks: 40.00, Total volume: 89.00, Time: 954.00
I only request to write the current bar from no.1 to no.3, but 6 output were found. I noted that after I used the statement "if month(date) <> month(date[1])", the current bar will be reset and started from the seventh bar. How can I resolved this problem?
Code: Select all
for value1 = 1 to 3
begin
if currentbar = value1 then
begin
value2 = Ticks + value2;
print("Ticks: ", Ticks, ", Total volume: ", value2, ", Time: ", Time);
end;
end;
Ticks: 71.00, Total volume: 71.00, Time: 946.00
Ticks: 69.00, Total volume: 140.00, Time: 947.00
Ticks: 76.00, Total volume: 216.00, Time: 948.00