Close position when reach a specific value of RSI or sequence values of RSI

MQL5 Indikatoren Experten

Spezifikation

hi

When RSI value reach the following condition, only (close short position) and not ( close short position and open a long position)?

//--- checking of conditions to close short position
//--- signal line crossover of overbought/oversold levels (upward 30, upward 70)
  if((RSI(1)<50) && (RSI(2)>50)))
     result=40;

what is the best way to achive this? Isn't it through a trailing stop? or i have another way



//+------------------------------------------------------------------+
//| Checks conditions for entry and exit from market                 |
//| 1) Market entry (open long position, result=80)                  |
//| 2) Market exit (close short position, result=40)                 |
//+------------------------------------------------------------------+
int CBE_BE_RSI::LongCondition()
  {
   int result=0;
//--- idx can be used to determine Expert Advisor work mode
//--- idx=0 - in this case EA checks trade conditions at each tick
//--- idx=1 - in this case EA checks trade consition only at news bars
   int idx   =StartIndex();
//--- checking of conditions to open long position
//--- formation of Bullish Engulfing pattern and RSI<30
  if(CheckCandlestickPattern(CANDLE_PATTERN_BULLISH_ENGULFING) && (RSI(1)<40))
     result=80;
//--- checking of conditions to close short position
//--- signal line crossover of oerbought/oversold levels (upward 30, upward 70)
  if((RSI(1)<50) && (RSI(2)>50)))
     result=40;
//--- return result
   return(result);
  }

//+------------------------------------------------------------------+
//| Checks conditions for entry and exit from market                 |
//| 1) Market entry (open short position, result=80)                 |
//| 2) Market exit (close long position, result=40)                  |
//+------------------------------------------------------------------+
int CBE_BE_RSI::ShortCondition()
  {
   int result=0;
//--- idx can be used to determine Expert Advisor work mode
//--- idx=0 - in this case EA checks trade conditions at each tick
//--- idx=1 - in this case EA checks trade consition only at news bars
   int idx   =StartIndex();
//--- checking of conditions to open short position
//--- formation of Bearish Engulfing pattern and RSI>60
  if(CheckCandlestickPattern(CANDLE_PATTERN_BEARISH_ENGULFING) && (RSI(1)>60))
     result=80;
//--- checking of conditions to close long position
//--- signal line crossover of overbought/oversold levels (downward 70, downward 30)
  if((RSI(1)>50) && (RSI(2)<50)))
     result=40;
//--- return result
   return(result);
  }

Bewerbungen

1
Entwickler 1
Bewertung
(12)
Projekte
13
31%
Schlichtung
1
0% / 100%
Frist nicht eingehalten
1
8%
Frei
2
Entwickler 2
Bewertung
(62)
Projekte
140
46%
Schlichtung
19
42% / 16%
Frist nicht eingehalten
32
23%
Frei
Ähnliche Aufträge
Hey MQL COMMUNITY, I have some ideas trading that needed to come to life based on my expected trading target, I have the details strategy ready so I wanted to be programmed as PineScript Indicators based on my trading specifications for TradingView platform, please reach out if you are well skilled in programming algo trading system for tradingview using PineScript coding solutions and can run without any problem
Hello i am seeking a skilled MetaTrader 5 (MQL5) developer to modify an existing Telegram signal copier. The goal is to enhance the copier's functionality, reliability, and user experience. kindly bid this job to get started immediately
Hello, I’m looking for assistance with creating or customizing a TradingView indicator to suit my trading needs. If you have experience in this area, please reach out. Your help would be greatly appreciated. Thanks
Where are my developers colleagues . i want you to support me on existing work i just need a little addon on it. Am still a student kindly support me. You will be get paid at the end of the work. If you want more details maybe the worth of the project or any other thing let me know. THNAKS FOR THE SUPPORT
** Entry Condition **: - ** For Long**: The trade is entered **after BB + ** is confirmed. - ** For Short *: The trade is entered **after BB -* is confirmed. ### 2nd **Stop Loss **: - ** For long Entries *: stop loss is triggered on a ** candle close above the high* of the breaker block shown by the indicator. - ** For Short Entries **: stop loss is triggered on a ** candle close below the low ** of the breaker block
Hello, am in need of a developer that can help in developing a trading bot that can effectively navigate the foreign exchange (Forex) market or other financial markets to generate passive income. My objective is to create a sophisticated algorithmic trading system that can consistently produce profitable trades with minimal manual intervention. I am seeking a reliable and efficient solution that can be tailored to my
am looking for who help me convert tradingview indicator to mt5 car trading strategy and make sure you are an expert before u apply to this and also my budget for this is 30$ so the name of the indicator is Breaker Blocks with Signals (LuxAlgo) ### 1. ** Entry Condition **: - ** For Long**: The trade is entered **after BB + ** is confirmed. - ** For Short *: The trade is entered **after BB -* is confirmed. ### 2nd
I have a custom MT4 indicator that I need converted to MT5. I'll share the source code with the applicants. Please only apply if you have vast experience in converting complex indicators successfully to MT5, and making sure that the MT5 version functions exactly the same as the MT4 version
I need an expert to help me convert chopzone traingview pinescript to mt4, I need an expert to get it done for me on between 1 to 2 days i hope this will be done by then, i will attach the file and my budget is $30 as of minimum here
Looking for someone to edit/optimize and existing NN (neural network) in my EA so it is more compatible/profitable with the multiple strategies. The expert advisor is a portfolio expert advisor consisting of 33 separate advisors/strategies compiled into one. A NN has been added to the EA but it does not compliment or help the EA's performance. I've attached the original EA (without NN) as well as the EA with the NN

Projektdetails

Budget