The code doesn't really make much sense.
What is the "j" loop doing?
The continue statement is unnecessary.
After the first run of your "i" loop, the objects have been created. On the subsequent runs, you will be trying to create an object that already exists.
Checking your return codes from ObjectCreate would have helped you.
adka:
for(int j=0; j<=100; j++) {
for(int i=0; i<=10; i++) {
if (Close[i+1]>Open[i+1])
ObjectCreate(0,"pionowa"+"_"+i+"_", OBJ_VLINE, 0, Time[i+1], 0);
continue;
}
}
}
You should then use new data and not history.
Hi,
Why this code draws vlines only on history in MT4 tester?
I'd like to it worked on new data.
void OnTick () {
for(int j=0; j<=100; j++) {
for(int i=0; i<=10; i++) {
if (Close[i+1]>Open[i+1])
ObjectCreate(0,"pionowa"+"_"+i+"_", OBJ_VLINE, 0, Time[i+1], 0);
continue;
}
}
}

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
Why this code draws vlines only on history in MT4 tester?
I'd like to it worked on new data.
void OnTick () {
for(int j=0; j<=100; j++) {
for(int i=0; i<=10; i++) {
if (Close[i+1]>Open[i+1])
ObjectCreate(0,"pionowa"+"_"+i+"_", OBJ_VLINE, 0, Time[i+1], 0);
continue;
}
}
}