Just add a function to close the sells when a buy signal appears and another function to close the buys when a sell signal appears.
if(FastBuffer[1] >= SlowBuffer[1] && FastBuffer[0] < SlowBuffer[0]){ //close buys }
I tried this but it didn't work, would you mind if you complete the code above please?
Many thanks
Regards
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all
I have a short simple code here below, if anyone could help please , it would be really appreciated.
Main idea is when the fast ema cross over slow ema then to open a buy position and actually it works quite well with the code below.
However I need your help about how to close the position when the opposite happens; Slow EMA crossover the Fast EMA?
I don't want to use SL or TP options. As my main idea is keeping the trade open unless the slow ema crossover fast ema.
Many thanks
Regards