Just creating a strategy and i'm getting hung up on why the code isn't functioning the way it is.
I have a code situated like this:
if (((AdaptiveLaguerre(iadaptlength1, 1, 2, igammasmooth1, igammasmoothmode1,
ilperiod1, 0.38, 2).MovAvgUp[0] == AdaptiveLaguerre(iadaptlength1, 1, 2, igammasmooth1, igammasmoothmode1,ilperiod1, 0.38, 2).Laguerre[0]))
&&
((AdaptiveLaguerre(iadaptlength2, 1, 2, igammasmooth2, igammasmoothmode2, ilperiod2, 0.38, 2).MovAvgUp[0] ==AdaptiveLaguerre(iadaptlength2, 1, 2, igammasmooth2, igammasmoothmode2, ilperiod2, 0.38, 2).Laguerre[0]))
&&
((AdaptiveLaguerre(iadaptlength3, 1, 2, igammasmooth3, igammasmoothmode3,
ilperiod3, 0.38, 2).MovAvgUp[0] == AdaptiveLaguerre(iadaptlength3, 1, 2, igammasmooth3, igammasmoothmode3, ilperiod3, 0.38, 2).Laguerre[0] )))
{
EnterLong(Sharesinplay, "Long");
}
Please see image
Now it is suppose to enter long when all three are true (as in green), like it did with the short (red). However when it entered long, only 2 out of 3 laguerres were green and it still thought it should go long, when as you can see in the code, to go long, all three laguerres have to be true.
I believe the code is not resetting on every Barupdate. How can reset the laguerre's so on each barupdate it looks for the parameters on just the previous bar? Isn't the code I have suppose to do that already? Any information would be greatly appreciated!!
Hope that makes sense.
Comment