MQL4 - automated forex trading   /  

Forum

Problem with setting stop loss

Back to topics list To post a new topic, please log in or register

avatar
2
brian2mn 2009.11.13 08:15 
I'm somewhat of a VB convert to MQL4 and am trying to figure out some demo code that I found. I'm running back testing with this piece of code, and have noticed that sometimes my stop loss doesn't seem to set at all.....it will enter into a position and just sit there, sometimes for days, and then all of a sudden close out at a huge loss. Can anyone point me in the right direction as to what isn't right with this code? Thanks!
Attached files:
  MACDnSample.mq4 (5.48 KB)
Terminal Service Client. How to Make Pocket PC a Big Brother's Friend

Terminal Service Client. How to Make Pocket PC a Big Brother's Friend

The article describes the way of connecting to the remote PC with installed MT4 Client Terminal via a PDA.


avatar
40
Gachette 2009.11.13 20:54 
brian2mn wrote >>
I'm somewhat of a VB convert to MQL4 and am trying to figure out some demo code that I found. I'm running back testing with this piece of code, and have noticed that sometimes my stop loss doesn't seem to set at all.....it will enter into a position and just sit there, sometimes for days, and then all of a sudden close out at a huge loss. Can anyone point me in the right direction as to what isn't right with this code? Thanks!

hi, just a question: why dont you send a stoploss in the OrderSend and than modify it with your Ordermodify and get the getlasterror send you the problem ?

By the way, I dont see any getlasterror in your coding for modifyorder (there is only in the ordersend), maybe it would help you alot ?


avatar
2
brian2mn 2009.11.14 07:04 
Thanks for the response.....this code was really a sample MACD test that came preloaded with Meta Trader 4 that I downloaded from forex.com, so I didn't write it myself. Do you know where in the code that I would put that modification and how? Thanks!
Back to topics list  

To add comments, please log in or register