Topic: MQL and nested if statements
I've nested 2 if-statements into 1. No matter what I do, I get entry values taken from 2 days back...
It can't be normal, can it? Because current indi value is correct, therefore when condition is satisfied, it should mark the same indi value as the entry price. But no, MT shows value, which was correct 2 days ago!
A non-working example:
if (ListParam[0].Text == "Continous entry") //entry condition
{
if (nosignal[bar] != 1) //take only first signal
{
if (Data.Open[bar] < value[bar]) //if open price below indi value, set up long
{
Component[1].Value[bar] = value[bar]; //long entry value
}
else if (Data.Open[bar] > value[bar]) //if open price above indi value, set up short
{
Component[2].Value[bar] = value[bar]; //short entry value
}
}
}
And this example below works as I get the correct/current numbers on dash.
if (ListParam[0].Text == "Continous entry")
{
Component[1].Value[bar] = value[bar];
}