The calculation formula for RSI indicator is as follows:
RSI = 100 – 100/ (1 + RS)
RS = Average Gain of n days UP / Average Loss of n days DOWN
Please follow this URL link to learn more about the RSI indicator:
This is my PHP code:
$sum_up=0.0;$sum_up_count=0;
$sum_down=0.0;$sum_down_count=0;
for($i=0;$i0){
$sum_up+=$ch;
$sum_up_count++;
}else if($ch
The RSI formula you sent out, I know, but the result is wrong. I saw in your tutorial that you have a parameter called RMA. What is the basis of this parameter? our calculation lacks this parameter. Resulting in incorrect results. What is the full name of rma, is it EMA or EWMA.Thank you
Average Gain of n days UP / Average Loss of n days DOWN
What exactly are these two parameters? are they measured by day or by number of candles?
Consult the calculation formula of the index: RSI in the exchange, and ask for consistency with the calculation result of the exchange.
Similar orders
I have a High-Frequency Trading (HFT) Expert Advisor for both MT4 and MT5. The EA performs consistently and profitably on demo accounts, but when I run it on an IC Markets Raw or Standard live account, it starts generating losses under what appear to be the same trading conditions. At this time, I cannot provide the source code (.mq4/.mq5). I can only provide the compiled EA (.ex4/.ex5) for testing and analysis. I am
Act as a professional Quantitative Developer and Risk Manager. I want to build a systematic trading strategy rulebook that prioritizes capital preservation and statistical edge over raw performance. Please generate a structured trading strategy using the following framework: 1. ASSET CLASS & TIMEFRAME: - Asset: [e.g., Apple (AAPL), Bitcoin (BTC), or EUR/USD] - Timeframe: [e.g., 5-minute, 1-hour, Daily] 2. CORE
Part 1: Project setup Input settings (risk, stop loss, take profit, EMA periods) Indicator initialization Trade management framework Part 2: Trading logic EMA crossover detection Buy/Sell entry rules One-trade-per-symbol check Part 3: Risk management Automatic lot size calculation Stop-loss and take-profit placement Trade execution and error handling Part 4: Final touches On-screen information Optimization