Trailing stop through the RSI value ??

Jorge Cardoso
65
Jorge Cardoso  
hi,

Guys the question is: Is it possible to create a trailing stop from the RSI value of the last candle?

If so what is the best method ...

Thanks in advance for all the answers ...

J. Costa
Alain Verleyen
42221
Alain Verleyen  
jorgeemec:
hi,

Guys the question is: Is it possible to create a trailing stop from the RSI value of the last candle?

If so what is the best method ...

Thanks in advance for all the answers ...

J. Costa
RSI give you a value between 0 and 100. How will you use this value for your stop ?
Jorge Cardoso
65
Jorge Cardoso  
angevoyageur:
RSI give you a value between 0 and 100. How will you use this value for your stop ?

hi,


For example: I am in a longposition and when the value of the RSI pass the value 50, upwards, gives a stop signal. Not sell as i have now.

Alain Verleyen
42221
Alain Verleyen  
jorgeemec:

hi,


For example: I am in a longposition and when the value of the RSI pass the value 50, upwards, gives a stop signal. Not sell as i have now.

I don't know what you have now.

Firstly you were talking about a trailing stop and now about a stop signal. It's not the same.

Jorge Cardoso
65
Jorge Cardoso  
angevoyageur:

I don't know what you have now.

Firstly you were talking about a trailing stop and now about a stop signal. It's not the same.

Ok, let me be more clear...

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);
  }
Alain Verleyen
42221
Alain Verleyen  
jorgeemec:
Ok, let me be more clear...

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

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



Ok I see, it's for a Mql5 Wizard generated EA. Are you a coder ? If yes you can check this topic to help you to understand how it works.

Otherwise you will have to ask a programmer to do it for you.

In all case what you ask has nothing to do with a trailing stop.

All about MQL5 Wizard : create robots without programming.
All about MQL5 Wizard : create robots without programming.
  • www.mql5.com
What is MQL5 Wizard :The MetaTrader 5 Trading Platform includes the MQL5 Wizard, which allows to quickly generate code of an Expert Advisor (Expert Advisor builder). - - Category: general
flwilliams87
228
flwilliams87  
jorgeemec:
Ok, let me be more clear...

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

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



where are you getting or how are you calculating the value of RSI? I can't seem to locate it or create it.