1. If MACD >0 BUY
2. If MACD < 0 SELL
3. Stop Loss and Profit
4. Do not check for these conditions again until a new MACD crossover occurs.
The tricky party is coding no. 4 . 1, 2 and 3 are easy. The problem is that it keeps buying or selling, even if a stop loss or profit occurs because the conditions are still true and not waiting for the next macd crossover to occur. I know this is probably an if statement within an if statement, but nothing seems to be working for me. Any suggestions?
Comment