BurtonM
New member
MT4 RSI KER Kaufman Efficiency Ratio EA Trading Strategy That PRINTS Money
This strategy comes from a video by Ali Casey at StatOasis on YouTube,Thank you Ali for sharing all your data analysis, and backtesting.
RSI Trading Strategy That PRINTS Money

It is important you watch the video link above to understand the EA I have coded.
KER refers to the Kaufman Efficiency Ratio. The KER calculation is internally coded.
IMPORTANT: This MT4 EA strategy is developed and backtested on the S&P500 Daily timeframe.
I have coded other versions: MT5 version is here.
Main Features:
Entry conditions: RSI < entry level and KER[2] > thresholdExit conditions: RSI > exit level or max bars held
Stop loss implementation
Position size management
I have coded a NewOrderReliable library that provides several important advantages for an EA:
Retry Mechanism:
- If an order fails to execute, the library automatically retries up to 10 times (defined by retry_attempts)
- This helps handle temporary network issues or broker server delays
- Each retry attempt includes a random sleep time between attempts to avoid overwhelming the server
Error Handling:
- Better error detection and reporting through OrderReliableErrTxt function
- Detailed error messages are printed for debugging
- Specific handling for common errors like invalid prices or stops
- Helps identify why trades aren't executing as expected
Sleep Randomization:
- Uses OrderReliable_SleepRandomTime between retries
- Sleep time varies between 4.0 and 25.0 seconds (defined by sleep_time and sleep_maximum)
- Helps prevent request flooding and reduces server rejection probability
- More broker-friendly than immediate retries
Order Selection Safety:
- OrderSelectReliable function provides safer order selection
- Helps prevent issues with concurrent access to order selection
- More reliable than standard OrderSelect when managing multiple orders
Trade Validation:
- Includes built-in validation for stop losses through OrderReliable_EnsureValidStop
- Helps prevent invalid order parameters from being sent
- Reduces errors due to incorrect price levels
Consistency:
- Provides consistent behavior across different brokers
- Helps handle varying broker server response times
- More reliable execution in different market conditions
Maintenance Benefits:
- Centralized order handling code
- Easier to update and maintain trading logic
- Consistent error handling across multiple EAs
Server Load Management:
- Intelligent retry timing helps reduce server load
- Better compliance with broker API limitations
- Reduces risk of being blocked for excessive requests
Put the NewOrderReliable.mqh file in the experts/include directory.
Test the EA on a Demo account to check that it is opening and closing trades correctly.
Attachments
Last edited: