there is a little bug, please change the red line
double SetTarget4H(string tradedirection4H)
{
............
if (tradedirection4H == buy) // BUY
{
.................
if (UseAtrTp) // use Atr
{ //EntryPrice = Ask;
AtrVal = iATR(Symbol(), AtrTpTimeFrame, AtrTpPeriod, 0) * AtrTpMultiplier;
if (AtrVal<MinDist) AtrVal=MinDist;
target4H = NormalizeDouble(EntryPrice + AtrVal,Digits);
}//if (UseAtrTp)
}//if (tradedirection4H == buy)
return (NormalizeDouble(target4H,Digits));
}//End double SetTarget4H(string tradedirection4H)
double SetTarget4H(string tradedirection4H)
{
............
if (tradedirection4H == buy) // BUY
{
.................
if (UseAtrTp) // use Atr
{ //EntryPrice = Ask;
AtrVal = iATR(Symbol(), AtrTpTimeFrame, AtrTpPeriod, 0) * AtrTpMultiplier;
if (AtrVal<MinDist) AtrVal=MinDist;
target4H = NormalizeDouble(EntryPrice + AtrVal,Digits);
}//if (UseAtrTp)
}//if (tradedirection4H == buy)
return (NormalizeDouble(target4H,Digits));
}//End double SetTarget4H(string tradedirection4H)