Need help with candle close code

Post Reply
Chewbaca2020
Posts: 4
Joined: Sat Sep 06, 2014 8:26 am

Need help with candle close code

Post by Chewbaca2020 »

I'm trying to code a a break out system. There is a piece of code that I would like to close if it doesn't meet the condition. For example, I want to open a sell if RSI<30 and current close is less then open.

However, I would like to close the trade if the next candle close is greater than the close of the candle that I open the trade on.

So essentially I simply want to close the trade immediately if the next candle close has changed direction.

If RSI<30 && CCI>177 then open

If the candle close after the candle that I opened the trade on is higher then I want to close the trade immediately.

Can anybody help?
Post Reply

Return to “Coders Hangout”