• Join us

Requests & Ideas - page 545

Rogerio Borges
1146
Rogerio Borges  
mladen:
Error 130 means that the price is wrong (either the take profit and/or stop loss it is too close to the current price or it is at the "wrong" side of the current price). Try using different tp and sl and check what happens

Dear Mladen,

I'm testing an EA with nonlagma_nrp_1_1 and I_XO_A_H.

The error only occurs when trying to use the Lock profit function.


Following full EA mq4 attached.

extern bool      UsarLockProfit= true;
bool             StealthMode  = false;
extern double       LockProfit1  = 1;
extern double       LockProfit2  = 2;
extern double       LockProfit3  = 3;
extern double       LockProfit4  = 4;
extern double       LockProfit5  = 5;
extern double       LockProfit6  = 6;
extern double       LockProfit7  = 7;
extern double       LockProfit8  = 8;
extern double       LockProfit9  = 10;
extern double       LockProfit10 = 20;

Exemplo lock profit

 if(OPtotal > 0)
  {
     double Pips_Buy            = Bid-OrderOpenPrice();
     double Pips_Sell           = OrderOpenPrice()-Ask;
     double Pips_Lock1          = LockProfit1 * myPoint;
     double Pips_Lock2          = LockProfit2 * myPoint;
     double Pips_Lock3          = LockProfit3 * myPoint;
     double Pips_Lock4          = LockProfit4 * myPoint;
     double Pips_Lock5          = LockProfit5 * myPoint;
     double Pips_Lock6          = LockProfit6 * myPoint;
     double Pips_Lock7          = LockProfit7 * myPoint;
     double Pips_Lock8          = LockProfit8 * myPoint;
     double Pips_Lock9          = LockProfit9 * myPoint;
     double Pips_Lock10         = LockProfit10 * myPoint;
 
     
     if(OPBuy > 0 && OPSell == 0)
       {
        if (Pips_Buy > Pips_Lock1 && Pips_Buy < Pips_Lock2)
        {   if(StealthMode==false){ dummyResult=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+Pips_Lock1,OrderTakeProfit(),0,CLR_NONE); }
            if(StealthMode==true)
              { if (Close[1]<Close[2] && Pips_Buy >= Pips_Lock1 && Pips_Buy < Pips_Lock2) { close_all(); }
              }
        }
        if (Pips_Buy > Pips_Lock2 && Pips_Buy < Pips_Lock3)
        {   if(StealthMode==false){ dummyResult=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+Pips_Lock2,OrderTakeProfit(),0,CLR_NONE); }
            if(StealthMode==true)
              { if (Close[1]<Close[2] && Pips_Buy >= Pips_Lock2 && Pips_Buy < Pips_Lock3) { close_all(); }
              }
        }
Files:
Nonlagma.zip 9 kb
Mladen Rakic
163286
Mladen Rakic  
borgesr:

Dear Mladen,

I'm testing an EA with nonlagma_nrp_1_1 and I_XO_A_H.

The error only occurs when trying to use the Lock profit function.


Following full EA mq4 attached.

You can not use OrderOpenPrice() as basis for take profit and stop loss in the OrderModify() when the open price is different from the current price (and, in any case, that is wrong).
Rogerio Borges
1146
Rogerio Borges  
mladen:
You can not use OrderOpenPrice() as basis for take profit and stop loss in the OrderModify() when the open price is different from the current price (and, in any case, that is wrong).

Thanks for the answer.
I will check the EA
bband_trailing_stop1_nmc.mq4 code posted on the forum and check if it helps me to correct the error.

This EA uses BBANDS STOP but in some tests I did with BBANDS just closing the very negative stop.



Sorry for simple questions but I am still learning with what I find on the Internet in Brazil we do not have god MQL courses.

Thank you.

Rogério

Ahmet
639
Ahmet  
mladen:
You can not use OrderOpenPrice() as basis for take profit and stop loss in the OrderModify() when the open price is different from the current price (and, in any case, that is wrong).

Dear @mladen,

Can you update these indicators please?

Because they says, "You are trying to use renamed indicator" on mt4 build 950!

(adaptive_laguerre_filter_mtf__alerts_3_2_histo, bullbeareyes_averages_adaptive, stepma_of_rsi_adaptive_ema_2_3_1)


Also, is "StepMA_v7.2a histo" repaint or not?

Mladen Rakic
163286
Mladen Rakic  
oguz:

Dear @mladen,

Can you update these indicators please?

Because they says, "You are trying to use renamed indicator" on mt4 build 950!

(adaptive_laguerre_filter_mtf__alerts_3_2_histo, bullbeareyes_averages_adaptive, stepma_of_rsi_adaptive_ema_2_3_1)


Also, is "StepMA_v7.2a histo" repaint or not?

No need for an update

replace the "_" with " " and it will work (except where it ends in the version number, there the "_" should stay)

As far as I see developers have solved the issue with file names and cases like that should not happen from now on

___________________

As of stepma 7.2 : guys, when someone asks me something in a PM and then someone completely else asks me the same thing at the forum, what should I think? And all in a matter of a few hours

Mladen Rakic
163286
Mladen Rakic  
oguz:

Dear @mladen,

Can you update these indicators please?

Because they says, "You are trying to use renamed indicator" on mt4 build 950!

(adaptive_laguerre_filter_mtf__alerts_3_2_histo, bullbeareyes_averages_adaptive, stepma_of_rsi_adaptive_ema_2_3_1)


Also, is "StepMA_v7.2a histo" repaint or not?

PS: please read this post https://www.mql5.com/en/forum/180514/page156
krelian99
1202
krelian99  
mladen: [...] ___________________

As of stepma 7.2 : guys, when someone asks me something in a PM and then someone completely else asks me the same thing at the forum, what should I think? And all in a matter of a few hours

The completely else is impatient and has a bad multi ID management ;)
Ahmet
639
Ahmet  
mladen:
PS: please read this post https://www.mql5.com/en/forum/180514/page156

Thank you for detailed information.

I don't send you a pm messages about StepMA 7.2 repaint. Because there is no need to throw messages pm for it :) I think it is an interesting coincidence .

Ahmet
639
Ahmet  
krelian99:
The completely else is impatient and has a bad multi ID management ;)
Are you sure about this? I would be very pleased if you can prove ?
Ahmet
639
Ahmet  
mladen:

No need for an update

replace the "_" with " " and it will work (except where it ends in the version number, there the "_" should stay)

As far as I see developers have solved the issue with file names and cases like that should not happen from now on

___________________

As of stepma 7.2 : guys, when someone asks me something in a PM and then someone completely else asks me the same thing at the forum, what should I think? And all in a matter of a few hours

Dear @mladen,

Did they tell you , but I was not successful. :( I would be very pleased if you rename them.

Thank you very much...