I am trying to create a basic ma cross-over system with a third ma that acts as a filter, the ma cross should only fire a trade if the 3rd MA is sloping incorrect angle.
So two questions:
Is this [Ref(Moving3 > moving3,-5);] an effective way to ensure the 3rdma is sloping up or down?
With the code below, will it only enter a trade only occur if the cross happens whilst the ma3 is sloping the correct way? How would I modify to say that if all these conditions are met, buy: ma1 > ma2 and ma3 is sloping upward?
Okay I am coming stuck again, I am trying to set the either buy/sell condition as constant, so whever both conditions are true, a buy signal is initiated. Reading up I think it is about state condition ? I tried adding the () but says somehign about not a function.
Anyone able to help out with mutliple consistent buy conditions ?
Okay, the code is working, well it appears to be anyway However, I have located another issue. How do you only initaive a cover, when there is an existing short? Right now the code fires a cover, right before a buy if teh mas's line up?
With this statement, Buy will = 1 (True) when MA3Rising is true the first time, and then will remain 0 until EntryCross is True. So you could get entries simply by MA3Rising.
Exrem() isn't required for buy/sell in backtestregular() as it already handles the redundant signals so you can eliminate that.
And not sure what your last post is asking. Your buy signal and cover signal are identical so it's going to cover and then buy.
Your second post is confusing as your buy and sell should never be true at same time as one is m > n and one is m < n. No idea what "m" and "n" are but perhaps start there.