Demo account and SL error 130

 

I have been beating my head against a wall here and cannot seem to figure out the answer.

I have been testing several EAs that work without error in the Strategy Tester. I opened a Demo account to test them live. In the demo, every time an order is supposed to execute, I get that "Error Opening BUY order : 130" or "Error Opening SELL order : 130" error which I understand has to do with stop losses. After setting the stop loss to a ton of different things. I am not sure what to do. I even constructed a very simple EA with crossing EMAs just to test it out.

What I am using to set a BUY order:

-With StopLoss as and external indicator
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"ema cross sample",16384,0,Green);

-or when just using a plugged stop loss - 500 points for example:

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-500*Point,Ask+TakeProfit*Point,"ema cross sample",16384,0,Green);


What I am using to set a SELL order:

-With StopLoss as and external indicator
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"ema cross sample",16384,0,Red);

-or when just using a plugged stop loss - 500 points for example:

ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+500*Point,Bid-TakeProfit*Point,"ema cross sample",16384,0,Red);


I am still getting that error 130. Can anyone help?


Is there a way to disable stop losses? If I go into the EA properties and set the manual order confirmation, then when the window pops up I can set a trade. I notice though on this window that Stop Losses are greyed out at 0. Does this make sense?


---------------------

Edit - I just saw that post that recommended putting Bid-StopLoss*Point for a Buy order and the error still happened. Is there a way to disable stop losses

 
ter42:

I have been beating my head against a wall here and cannot seem to figure out the answer.

I have been testing several EAs that work without error in the Strategy Tester. I opened a Demo account to test them live. In the demo, every time an order is supposed to execute, I get that "Error Opening BUY order : 130" or "Error Opening SELL order : 130" error which I understand has to do with stop losses. After setting the stop loss to a ton of different things. I am not sure what to do. I even constructed a very simple EA with crossing EMAs just to test it out.

What I am using to set a BUY order:

-With StopLoss as and external indicator
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"ema cross sample",16384,0,Green);

-or when just using a plugged stop loss - 500 points for example:

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-500*Point,Ask+TakeProfit*Point,"ema cross sample",16384,0,Green);


What I am using to set a SELL order:

-With StopLoss as and external indicator
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"ema cross sample",16384,0,Red);

-or when just using a plugged stop loss - 500 points for example:

ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+500*Point,Bid-TakeProfit*Point,"ema cross sample",16384,0,Red);


I am still getting that error 130. Can anyone help?


Is there a way to disable stop losses? If I go into the EA properties and set the manual order confirmation, then when the window pops up I can set a trade. I notice though on this window that Stop Losses are greyed out at 0. Does this make sense?


---------------------

Edit - I just saw that post that recommended putting Bid-StopLoss*Point for a Buy order and the error still happened. Is there a way to disable stop losses



im having the same problem, i use a external field to set sl / tp, on a demo account i can only do manual trades with sl/tp of 20 or more and on the EA it will only make a trade if sl / tp is 30 or more.

on a live account i can manualy trade at 8 pips sl/tp but have to set it at 30 pips on my EA to make a trade !!!

this defeats the reason for a unattended EA .

I think the solution is to run a loop checking each trades profit / loss and close them accordingly ......ahhhhh more coding on a nicely working EA !

 

i am facing same problem,

if i use (TP & SL & TS) the EA doesn't work.

IF i disable (TP & SL) and keep TS, the EA works and make trades. that what i get with FXCM.

while using same EA with same parameters and using (TP & SL & TS) on FXPRO and BFX Trader (Brokers), the EA works without problems.

Does that mean some brokers allow and others forbid?

 

Im using avafx - sl tp doesnt work, also tried it on Go Tradrer - didnt work.


i think some brokers dont like EA's ....

 
samirgham:

i am facing same problem,

if i use (TP & SL & TS) the EA doesn't work.

IF i disable (TP & SL) and keep TS, the EA works and make trades. that what i get with FXCM.

while using same EA with same parameters and using (TP & SL & TS) on FXPRO and BFX Trader (Brokers), the EA works without problems.

Does that mean some brokers allow and others forbid?

I am also on FXCM. That may be the problem. How do you "disable" TP & SL?? I can programatically make a SL and TP if I need to. I need to know how to disable SL and TP on order open.

 
ter42 wrote >>

I am also on FXCM. That may be the problem. How do you "disable" TP & SL?? I can programatically make a SL and TP if I need to. I need to know how to disable SL and TP on order open.

i meant by disable, that i put (extern int TakeProfit=0;) and (extern int StopLoss=0;)

so the EA doesn't read them and works.

 

found this:

Im running 2 open windows, one with the my EA and the other with this EA - seems to be working .....


http://www.forexfactory.com/showthread.php?t=9553

Hi Everyone,

I've developed an expert that is designed to help me stick to my system a bit better than what I do by myself. Use it at your own risk, though.

The expert works by taking profit out of a trade at various take profit levels. It also moves stop losses at designated levels. You have the ability to customize the following parameters:

* First_Target: This is the first take profit target, in pips, that you specify.
* Target_Increment: Once the first profit target is reached, the next target will increment by the amount specified by the target increment variable.
* Close_Lots: This is how many lots you want to take out at each target. For example, if you have 10 lots, you can take 1 lot out at each of 10 profit targets, or 5 lots out at each of two targets. It's up to you.
* Move_Stops: Set to true if you want the expert to move stops based on the First_Stop and Stop_Differential parameters. Otherwise, set to false if you don't want stops moved automatically.
* First_Stop_Target: This is the amount in pips the trade moves before your stop loss is moved to the First_Stop level.
* First_Stop: This will move your stop loss when a target, in pips, is reached. The number represents the number of pips from entry and can be postive or negative.
* Second_Stop_Target: This is the amount in pips the trade moves before your stop loss is moved to the Second_Stop level.
* Second_Stop: This will move your stop loss when a target, in pips, is reached. The number represents the number of pips from entry and can be postive or negative.
* Use_Max_Loss: Set to true if you want to input your own stoploss and hide your stop value from your broker. This is the maximum loss you'll risk on the trade. It's irrelevant if Move_Stops is set to true AND Move_Stops was triggered.
* Max_Loss: This is the maximum pip loss you'll accept on the trade. If set to 0, this function is disabled.
* Magic_Number: You can use this to ensure the expert only manages trades with a particular magic number. This will allow you to trade the same pair using different systems without this expert interfering with the take profit points of the other trade(s).

The image below represents example parameters that can be set for the expert. I'll explain each one with a scenario. Assume you place a 1 lot sell order for EURUSD at 1.2100 (1.2103/1.2100 - ask/bid). (Assume a 3 pip spread.)

* The expert will take .1 lots ("Close_Lots"), or 1/10th of this scenario's order, out at +10 pips ("First_Target"), or 1.2090/1.2087.
* After that, the next profit target will increment 8 pips ("Target_Increment") to 1.2082/1.2079. and another .1 lots will be taken out at that level. The expert continues to increment the preceding profit target by 8 pips until the original order is closed. In this example, the maximum pips gained would be 10 + (8*9), or 82 pips. (First target pips + increment pips * number of times to increment, which would vary depending on the original order size and the "Close_Lots" parameter.)
* When the trade reaches +15 pips ("First_Stop_Target"), the stop loss will be moved to -5 pips ("First_Stop") from the order entry price. In this case, the order entry price was 1.2100, so the new price would be 1.2105. This means that you would lose 5 pips if the trade turned. Set the "Stop_Differential" parameter to "0" in order to move stops to breakeven (1.2100). If this parameter were, for example, set to 5, then the stop loss would be moved to 1.2095, and you would have a 5 pip increase if the move turned against you and stopped you out.
* When the trade reaches +30 pips (Second_Stop_Target), the SL is moved to Entry Price + 10 pips.
* If you don't want the expert to move the order's stop loss, then set the "Move_Stops" parameter to "false". I think this works, but haven't fully tested it.
 
ter42:

I have been beating my head against a wall here and cannot seem to figure out the answer.

I have been testing several EAs that work without error in the Strategy Tester. I opened a Demo account to test them live. In the demo, every time an order is supposed to execute, I get that "Error Opening BUY order : 130" or "Error Opening SELL order : 130" error which I understand has to do with stop losses. After setting the stop loss to a ton of different things. I am not sure what to do. I even constructed a very simple EA with crossing EMAs just to test it out.

What I am using to set a BUY order:

-With StopLoss as and external indicator
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"ema cross sample",16384,0,Green);

-or when just using a plugged stop loss - 500 points for example:

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-500*Point,Ask+TakeProfit*Point,"ema cross sample",16384,0,Green);


What I am using to set a SELL order:

-With StopLoss as and external indicator
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"ema cross sample",16384,0,Red);

-or when just using a plugged stop loss - 500 points for example:

ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+500*Point,Bid-TakeProfit*Point,"ema cross sample",16384,0,Red);


I am still getting that error 130. Can anyone help?


Is there a way to disable stop losses? If I go into the EA properties and set the manual order confirmation, then when the window pops up I can set a trade. I notice though on this window that Stop Losses are greyed out at 0. Does this make sense?


---------------------

Edit - I just saw that post that recommended putting Bid-StopLoss*Point for a Buy order and the error still happened. Is there a way to disable stop losses



Hi, I have the same problem since 2 days starting from last sunday when market has been opened.

I have more MIG account live and demo. All my stuff EAs and more works fine on live account, but on demo account since last sunday, when market has been opened I am still facing with the problem that all of you have.

I have been contacted to my broker MIG Bank some minutes ago, but it was useless, they said their system work fine... so I have the same issue if one of you knows something about it would be nice

Thanx

 
ter42:

I am also on FXCM. That may be the problem. How do you "disable" TP & SL?? I can programatically make a SL and TP if I need to. I need to know how to disable SL and TP on order open.


Hi, I have the same problem since 2 days starting from last sunday when market has been opened.

I have more MIG account live and demo. All my stuff EAs and more works fine on live account, but on demo account since last sunday, when market has been opened I am still facing with the problem that all of you have.

I have been contacted to my broker MIG Bank some minutes ago, but it was useless, they said their system work fine... so I have the same issue if one of you knows something about it would be nice

Thanx

 
samirgham:

i am facing same problem,

if i use (TP & SL & TS) the EA doesn't work.

IF i disable (TP & SL) and keep TS, the EA works and make trades. that what i get with FXCM.

while using same EA with same parameters and using (TP & SL & TS) on FXPRO and BFX Trader (Brokers), the EA works without problems.

Does that mean some brokers allow and others forbid?


Hi, I have the same problem since 2 days starting from last sunday when market has been opened.

I have more MIG account live and demo. All my stuff EAs and more works fine on live account, but on demo account since last sunday, when market has been opened I am still facing with the problem that all of you have.

I have been contacted to my broker MIG Bank some minutes ago, but it was useless, they said their system work fine... so I have the same issue if one of you knows something about it would be nice

Thanx

 
ter42:

I have been beating my head against a wall here and cannot seem to figure out the answer.

I have been testing several EAs that work without error in the Strategy Tester. I opened a Demo account to test them live. In the demo, every time an order is supposed to execute, I get that "Error Opening BUY order : 130" or "Error Opening SELL order : 130" error which I understand has to do with stop losses. After setting the stop loss to a ton of different things. I am not sure what to do. I even constructed a very simple EA with crossing EMAs just to test it out.

What I am using to set a BUY order:

-With StopLoss as and external indicator
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"ema cross sample",16384,0,Green);

-or when just using a plugged stop loss - 500 points for example:

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-500*Point,Ask+TakeProfit*Point,"ema cross sample",16384,0,Green);


What I am using to set a SELL order:

-With StopLoss as and external indicator
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"ema cross sample",16384,0,Red);

-or when just using a plugged stop loss - 500 points for example:

ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+500*Point,Bid-TakeProfit*Point,"ema cross sample",16384,0,Red);


I am still getting that error 130. Can anyone help?


Is there a way to disable stop losses? If I go into the EA properties and set the manual order confirmation, then when the window pops up I can set a trade. I notice though on this window that Stop Losses are greyed out at 0. Does this make sense?


---------------------

Edit - I just saw that post that recommended putting Bid-StopLoss*Point for a Buy order and the error still happened. Is there a way to disable stop losses



Hi, I have the same problem since 2 days starting from last sunday when market has been opened.

I have more MIG account live and demo. All my stuff EAs and more works fine on live account, but on demo account since last sunday, when market has been opened I am still facing with the problem that all of you have.

I have been contacted to my broker MIG Bank some minutes ago, but it was useless, they said their system work fine... so I have the same issue if one of you knows something about it would be nice

Thanx

Reason: