Meaning that my logic isn't working as expected.
Simply, the strategy uses 2 MA crossovers to enter a position and one to exit.
Only one trade allowed at a time.
So the BP should be above the fast, and the medium should cross above the slow to initiate a long position. Exit when the medium crosses below the slow. ( this would be "on bar close"). The opposite for a short trade.
I would appreciate if someone can examine my code and advise me where I may have gone wrong and suggest how I might correct it. I am a novice coder and have done some online courses, successfully coded a few simple indicators, but am struggling with this.
Please be nice
Thanks, Ken.
Comment