I'm new to mql4 and am confused with the basics. I want to prepare an exit strategy. Here are the conditions. If it's a buy trade and we have to sell for closing the order:
- The candle should give a close below the Supertrend.
- Next candle should cut the low of the previous candle.
Below is the part of the code I've prepared.
i=1;
if (Close[i]<st)
{
low=close[1];
a=checkt1();
if (a==True)
{
OrderClose()
}
}
else if(Close[i]>st)
{
return(EMPTY_VALUE);
}
bool check1t()
{
if (Ask<a && Bid<a)
{
CloseOrder();
}
return True
}
Here the value of close keeps changing as I have set it to close[1]. Is there any function or any way that can store the value of close of the candle that had cut supertrend only? And not take up any other values?