Forex Zone - Forex Forum

Ea required on RSI

Discussion started on New EA Coding

  • Newbie
  • Posts: 42
  • Points: 203
  • Likes Received: 17
  • Reputation: +2/-0
I need a simple Ea that will buy when RSI =>50  and sell when RSI< 50, tp and sl should be set,  if loss it will martingale with a multiplier other wise continue to trade with "Normal" lot size as set in parameters,

Linkback: https://www.forex.zone/new-ea-coding/26/ea-required-on-rsi/4430/
#1 - November 27, 2023, 10:14:59 AM

Administrator
  • Hero Member
  • Posts: 4682
  • Points: 34706
  • Likes Received: 4795
  • Reputation: +220/-14
Should this EA be for MT4?
#2 - November 27, 2023, 02:52:08 PM

  • Newbie
  • Posts: 42
  • Points: 203
  • Likes Received: 17
  • Reputation: +2/-0
Yes, EA for mt4
#3 - November 28, 2023, 12:52:00 PM

Administrator
  • Hero Member
  • Posts: 4682
  • Points: 34706
  • Likes Received: 4795
  • Reputation: +220/-14
buy when RSI =>50  and sell when RSI< 50
You mean the EA should have 1 trade open at a time, right? So let's say there is a buy open and then RSI goes below 50, the buy should close and then a sell should open. If so, you want to use closed RSI values, right? If not, you will get many trades opening and closing whenever RSI ranges around 50. For example, 49.9 to 50.1 and then 50.1 down to 49.8 and then 49.8 up to 50.2. And so on. If real-time RSI values are used then you will get many trades opening and closing in a short amount of time. Each time eating spreads or costing you commission.
#4 - November 28, 2023, 01:21:25 PM

  • Newbie
  • Posts: 42
  • Points: 203
  • Likes Received: 17
  • Reputation: +2/-0
Let me explain the strategy.

             RSI >=50,
            ea will buy with  fix take profit and stoploss as this will be input by the user. Now unless this trade is open no other trade will be opened.  case 1:  This trade hits take profit then another trade will be opened depending on the RSI value
                   Case 2;  This trade hits stoploss then another trade will be opened depending on the RSI value
                  So let us take the example of Gold, Gold is now 2046, RSI above 50 so a buy trade with lot size 0.01 (as input by user) will be opened take profit will be 2050, stoploss will be 2042, 4 pip tp and same sl, also note i want this ea specifically for gold
                Now if our trade hit tp then another buy trade will be opened at 2050 as RSI is in positive territory, take profit 2054, stop loss 2046 .
                  If our trade hit sl then another trade will be opened depending on the RSI Value with double lot size i.e. 0.02
                 If our 2nd trade again hit stoploss then 3rd trade will be opened depending on RSI value with double lot size i.e. 0.04
                 The ea will continue martingale unless a trade wins, then it will place trade with normal lot size i.e. 0.01
                  EA will input  how many times it will martingale. If it achieves profit it will stop working at a certain level
                 
                  I used this strategey manully on Gold and found good results. I hope it will work on EA also
#5 - November 29, 2023, 05:39:54 AM

Administrator
  • Hero Member
  • Posts: 4682
  • Points: 34706
  • Likes Received: 4795
  • Reputation: +220/-14
Attached is FZ RSI Martingale EA. See the notes below.


Gold is now 2046, RSI above 50 so a buy trade with lot size 0.01 (as input by user) will be opened take profit will be 2050, stoploss will be 2042, 4 pip tp and same sl
I noticed here that we are not on the same page about Pips, especially with Gold. Your example meant to me more like 40 pips or 400 pips (depending on broker). Definitely not 4 pips though. So the TakeProfit, StopLoss, and Slippage are all based in Points, not Pips. This is the recommended way to do it to ensure the EA will work on any broker and chart. No conversions are necessary.

To set this EA, simply think in terms of Points. For example, if Gold in your chart is 2045.25 then 1 Point up would be 2045.26. If your chart shows Gold as 2045.2 (a broker that offers less precision), then 1 Point up would be 2045.3.


EA will input  how many times it will martingale. If it achieves profit it will stop working at a certain level
A more simple EA was coded, which you mentioned in your first post. So it does not have these two options you mentioned later. If there are enough people interested in this EA, it could be modified later.


Other Notes:
  • In order for Martingale to work, the Multiplier setting must be greater than 0. Also, the EA specifically looks to see if an SL was hit since this is what you asked for. So let's say you close an order early in loss yourself, this is not an SL being hit. In this case, the EA will not use Martingale then. Martingale also will not be used if you don't set any SL at all too.
  • DLL must be enabled to use this EA. Except for back testing.
#6 - November 30, 2023, 02:38:21 AM
Attachments:

Members:

0 Members and 1 Guest are viewing this topic.