what's the matter with my program?

 

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-(StopLoss*Point),Ask+(TakeProfit*Point),"abc sample",16384,0,Green);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice(), "buy",OrderOpenTime());

}

my program is very simple and easy,but when i use it in practice account,there always appear an error code 130,sometime is error opening buy order:130,sometime happened in sell order .

i m very upset about this issue.can anybody tell me what's the matter with my program? one more funny things,i try to run the MACD SAMPLE,this error code come out again.

 

thank you,i wil try again .

 
wang:

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-(StopLoss*Point),Ask+(TakeProfit*Point),"abc sample",16384,0,Green);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice(), "buy",OrderOpenTime());

}

my program is very simple and easy,but when i use it in practice account,there always appear an error code 130,sometime is error opening buy order:130,sometime happened in sell order .

i m very upset about this issue.can anybody tell me what's the matter with my program? one more funny things,i try to run the MACD SAMPLE,this error code come out again.

Can you please place the following statements directly before the OrderSend() and post the log of the results.

Print("StopLoss is ",StopLoss);

Print("TakeProfit is ",TakeProfit);

Print("Broker StopLevel is ",MarketInfo(Symbol(),MODE_STOPLEVEL));


CB

 

hi cloudbreaker

thank you so much ..now i got another troubles .it's more important for me ....i have to solve this problem first.i need your help.

as i showed before,error 130 is always appeared,so i change my program like :ticket=ordersend(symbol(),op_sell,lots,3,0,0,"try sample,198010,0,red)

i didn't put stoploss value and takeprofit value .

but the following problems was happend.

2009.07.22 13:10:06 try1 EURUSD,M5: close #3994527 sell 0.10 EURUSD at 1.41886 at price 1.42006

2009.07.22 12:26:00 try1 EURUSD,M5: SELL order opened : 1.4189

2009.07.22 12:26:00 try1 EURUSD,M5: open #3994527 sell 0.10 EURUSD at 1.41886 ok

i m very confused,

why sell order opened at 1.4189 but not 1.41886 ?

so what's the decimal point ? is it 0.00001 ? or 0.0001? what's the diffenence between 0.0001 and 0.00001?

 

If you are planning to jump from problem to problem without taking the advice you are offered, then you will need to find someone else to help you.


Notes:

- The OrderSend() statement you've just posted doesn't have a price in it, has a spurious double quote and has lost its case, please post the actual functions you are using to produce the results you post

- Implement the print statements as I recommended above and post the results to solve the 130

- Start searching the forum for some answers before posting - there are many posts regarding the handling of 5 decimal places vs 4 decimal places - and 130 errors for that matter


It appears to me that you've got an EA which expects to talk only to a 2/4 decimal place broker and you are pointing it to a 3/5 decimal place broker. This could also be causing your 130 errors.


Tips:

- If necessary, you can add functionality in your EA to automatically adjust between broker types - or you can just make the static change to your EA if you only need to use one type of broker

- Use the Point and Digits variables

- Use NormalizeDouble() and DoubleToStr() functions

- Multiply TP, SL and Slippage by 10 for 3/5 place brokers


CB

Reason: