i dont know where the problem is. Can somebody help me. It doesnt make any sense.
the Method "ifl" works without any problems but if i am backtesting the "ifs" logic, wich is "ifl" only with switched "less-than signs", it wont give back any results. What is the proble?
I attached the whole file . moving.cs
Thanks alot for your hel
Best wishes
Felix
public bool ifs()
{
if(Close[0] < Open[0] && Close[1] < Open[1])
{
if(Low[0] < sma[0] && Low[1] < sma[1])
{
return true;
}
}
return false;
}
public bool ifl()
{
if(Close[0] > Open[0] && Close[1] > Open[1])
{
if(Low[0] > sma[0] && Low[1] > sma[1])
{
return true;
}
}
return false;
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if(ifs() )
{
EnterShort();
}
else{
ExitShort();
}
}
Comment