I am finding it difficult to make this ea, i want it to trade based on rsi values.
Buy Condition:
When the RSI condition for a buy is met (rsiValue >= 57.0), and there is no existing position (position == 0), and the total number of trades is less than the maximum allowed (totalTrades < maxTrades), the strategy opens a new buy trade.
Sell Condition:
When the RSI condition for a sell is met (rsiValue <= 43.0), and there is no existing position (position == 0), and the total number of trades is less than the maximum allowed (totalTrades < maxTrades), the strategy opens a new sell trade.
Exit Conditions:
When the RSI condition for exiting a buy or sell trade is met (rsiValue <= 54.9 for a long trade, rsiValue >= 44.9 for a short trade), the strategy closes the corresponding trade.