PLEASE HELP TO SOLVE THE 'ERROR130' FOR MARKET EXECUTION BROKER

 

Hi,

I tried the attached EA in market execution broker. But an error130 comes when EA try to open trade. This problem will solve when we use post fix SL and TP. Please help to modify the EA to fix SL&TP after the order.

Regards,

Jasim

Files:
 

All the info you need can be found by reading a few posts and learning a bit pf coding, if you don't want to learn you can pay someone to do it for you: MT4 & MT5 coding

The info you need is here: ECN

 

Additional warning on using iHigh() and iLow() in your code is "If local history is empty (not loaded), function iHigh() returns 0."

         if((iHigh(Symbol(), 0, 0) - OrderOpenPrice()) > ActivateTrailAfter * Point)
         {
            if(UseTrailingStop && TrailingStop > 0) 
            {
               if(OrderStopLoss() <  (iHigh(Symbol(), 0, 0) - Point * TrailingStop) || OrderStopLoss() == 0)
               {
                  OrderModify(OrderTicket(), OrderOpenPrice(), iHigh(Symbol(), 0, 0) - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);
               }
            }
         }

Takes no account of what the current price is so could be too close to allow updateing of SL and TP.

See Requirments and Limitatins of entering a trade

 
Ickyrus:

Additional warning on using iHigh() and iLow() in your code is "If local history is empty (not loaded), function iHigh() returns 0."

Takes no account of what the current price is so could be too close to allow updateing of SL and TP.

See Requirments and Limitatins of entering a trade


Thank you for your reply. Actually i have no idea about programming. Please send me back after add the modification in the given below program.


#property copyright "Code written by inuxfx"

#property link "inuxfx."

<SNIP>

 
Ickyrus:

Additional warning on using iHigh() and iLow() in your code is "If local history is empty (not loaded), function iHigh() returns 0."


         if((iHigh(Symbol(), 0, 0) - OrderOpenPrice()) > ActivateTrailAfter * Point)
         {
            if(UseTrailingStop && TrailingStop > 0) 
            {
               if(OrderStopLoss() <  (iHigh(Symbol(), 0, 0) - Point * TrailingStop) || OrderStopLoss() == 0)
               {
                  OrderModify(OrderTicket(), OrderOpenPrice(), iHigh(Symbol(), 0, 0) - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);
               }
            }
         }

man r u for real

iHigh(Symbol(), 0, 0) in not loaded ?
 

???? qjol I get tired sometimes - but my remark that the modify takes no account of the current price is accurate not quite sure what error you are pointing out.

The quote is from the documentation. on iHigh()

 
jasimpa:


Thank you for your reply. Actually i have no idea about programming. Please send me back after add the modification in the given below program.


#property copyright "Code written by inuxfx"

#property link "inuxfx."

<SNIP>


Please edit your post . . . .

Please use this to post code . . . it makes it easier to read.

 
Ickyrus:

???? qjol I get tired sometimes - but my remark that the modify takes no account of the current price is accurate not quite sure what error you are pointing out.

The quote is from the documentation. on iHigh()

if iHigh() is reading from a different Symbol or TF, u r right,

but, in this case (iHigh(Symbol(), 0, 0)) is the current Symbol & the currrent TF so, it's no way that it's not loaded !

Reason: