Discussion of article "How to Create Your Own Trailing Stop" - page 3

 

I have been using the SAR trailing stop according to your program for several years, but I find that it no longer fits my requirments. So I want to try the NRTR method, which I hadn't installed before, by just changing the include call parameters in my EA. Everything else I am doing just as before.

But I am getting the following error message:

'fabct1cN.mq5'    fabct1cN.mq5    1    1
'my_first_ea_nrtrtrailing.mq5'    my_first_ea_nrtrtrailing.mq5    1    1
'Sample_TrailingStop.mqh'    Sample_TrailingStop.mqh    1    1
'OnInit' - function already defined and has body    fabct1cN.mq5    134    5
'OnTimer' - function already defined and has body    fabct1cN.mq5    258    6
'OnDeinit' - function already defined and has body    fabct1cN.mq5    265    6
'OnTick' - function already defined and has body    fabct1cN.mq5    285    6
'Lot' - constant cannot be modified    fabct1cN.mq5    480    4
'Lot' - constant cannot be modified    fabct1cN.mq5    820    22
'Lot' - constant cannot be modified    fabct1cN.mq5    820    37
'Lot' - constant cannot be modified    fabct1cN.mq5    851    22
'Lot' - constant cannot be modified    fabct1cN.mq5    851    37
possible use of uninitialized variable 'tm'    Sample_TrailingStop.mqh    248    20

9 error(s), 1 warning(s)        10    2


Any suggestions would be greatly appreciated!

Thank you in advance!

Regards,

Locan.BBS

 

MetaEditor outputs

" possible use of uninitialised variable 'tm' Sample_TrailingStop.mqh "

pointing to the line

m_lasttime=tm[0];

 
Can you tell me why a timer is used in this article? At first glance, it makes the indicators update more often, is it really necessary?
 

Thank you. Great article.

For who that are having problem with indicator nrtr: it's necessary download and compile the indicator, because it isn't a default one. Below, it follows the link: https://www.mql5.com/en/code/145

NRTR
NRTR
  • votes: 20
  • 2010.07.26
  • Dmitry Fedoseev
  • www.mql5.com
The NRTR (Nick Rypock Trailing Reverse) indicator draws the base line (support and resistance) and a target line.
 
vlad-mir:

MetaEditor outputs

" possible use of uninitialised variable 'tm' Sample_TrailingStop.mqh "

pointing to the line

m_lasttime=tm[0];



     //--- The main method of controlling the position stoploss level 
      bool DoStoploss(){
            //--- if trailing stop is switched off
            if(!m_onoff){
               return(true);
            } 
         datetime tm[1];
         tm[0] = 0;
            //--- in bar mode get the time of the last bar
            if(!m_eachtick){ 
               //--- if the time could not be copied, terminate the method, the repetition will occur on the next tick, 
               if(CopyTime(m_symbol,m_timeframe,0,1,tm)==-1){
                  return(false); 
               }
               //--- if the bar time is equal to the time of the last method execution - terminate the method
               if(tm[0]==m_lasttime){ 
                  return(true);
               }
            }               
            //--- get indicator values
            if(!Refresh()){ 
               return(false);
            }    
 
Hi everybody.......well, my question is ¿why this class have not SCOPE OPERATORS (::)?

I try the Parabolic SAR method but doing the backtest i see "invalid request" response.
 
Hi all.........bien, I wonder why this class doesn't have AMBIT OPERATORS (::)?

I try the Parabolic SAR method but when I do the test-atras I see the response "invalid request".
 
Hi ...

I am trying to develop an EA I am having problems with "OrderSend". I do not understand programming language very much, I've already tried a lot of solutions and I did not find ... But it does not work. The message

"return value of 'OrderSend' should be checked"

appears ... It contains no errors, however no position is open during tests ... When testing with the demo account I'm not having success. The test runs and no position is opened at any time.


Can someone help me by indicating the necessary adjustments I should make?

 I test it on

BOVESPA (Brazil)/ WINJ17/Demo Account/Metatrade 5

Can someone help me?

Thank's

 
MetaQuotes Software Corp.:

New article How to Create Your Own Trailing Stop is published:

Author: Дмитрий

 

my_first_ea_sartrailing.mq5(26.61 KB


when compiling it gives five errors, I tried the downloaded one, and compiled it according to the instructions.....

at first I was happy that there is this article, now I'm sad that I can't use it, maybe I didn't understand something?

or I'm not doing it right..... hint me please!)