is your StopLoss negative ?
Nope, you can see my alert code above
Alert(OrderOpenPrice()," ",StopLoss," ",Point," ",OrderOpenPrice()-StopLoss*Point);
and the result is:
01:03:51 2009.10.05 12:00 EA GBPUSD,H1: Alert: 1.5954 30 0.0001 1.5984
Any thought??
I'm using IBFx MT4 v225
this is the complete function
void openbuy() { int ticket; //if the broker is NOT ECN if(!IsECNBroker) { RefreshRates(); ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,slippage,Ask-StopLoss*Point,0,comment,MagicNumber,0,Blue); if(ticket>0) { return(0); } else Alert("Error "+GetLastError()+" on opening a new order on "+Symbol()+" ("+per+")"); } //if the broker is ECN if(IsECNBroker) { RefreshRates(); ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,slippage,0,0,comment,MagicNumber,0,Blue); if(ticket>0) { OrderSelect(ticket,SELECT_BY_TICKET); Alert(OrderOpenPrice()," ",StopLoss," ",Point," ",OrderOpenPrice()-StopLoss*Point); if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-StopLoss*Point,OrderTakeProfit(),0,0)) { return(0); } } else Alert("Error "+GetLastError()+" on opening a new order on "+Symbol()+" ("+per+")"); } }
and if IsECNBroker=false, it's working fine.
Nope, you can see my alert code above
and the result is:
Any thought??
I'm using IBFx MT4 v225
yes you are right - i should have noticed that - my god, i am getting dumber every day ...
i have no answer - but i have noticed that MT4 behaves strange sometimes.
i know that i write some bugs, and i am used to detect them and correct them. but some things in MQ4 are really strange...
i write perl,php and sometimes c-code and debug them all by myself, but MQ4 behaves sometimes very strange.
i workaround this issues, but it looks like as is there a little amount of bugs in the compiler at the moment to me.
maybe i am wrong....
sorry, cant help you at the moment - i think about this issue...
yes you are right - i should have noticed that - my god, i am getting dumber every day ...
i have no answer - but i have noticed that MT4 behaves strange sometimes.
i know that i write some bugs, and i am used to detect them and correct them. but some things in MQ4 are really strange...
i write perl,php and sometimes c-code and debug them all by myself, but MQ4 behaves sometimes very strange.
i workaround this issues, but it looks like as is there a little amount of bugs in the compiler at the moment to me.
maybe i am wrong....
sorry, cant help you at the moment - i think about this issue...
No problem with that, we slip on someting sometimes. Thanks for your response, please let me know if you think about something.
Meanwhile, it looks like an MQL4 bug rather than code bug..
Thank you. I do believe the code is correct, and I'm not too surprise if the code is working on other terminal. But what's wrong with mine??
btw, why the "Point" on your log = 0?
2009.11.15 19:56:44 test GBPUSD,M5: 1.6705 300 0 1.6675
try setting your SL to 3
mt4 has many bugs and brokers mod mt4 and then things dont work so well .....

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi All,
Anybody know why the error appear??
codes:
Log file:
why 1.5954 minus 30 pips = 1.5984 ???
This slowly lead me to headache.. anybody can help?
Thank you