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!
Files:
macdnsample.mq4
6 kb
- Expert Advisor problem
- help with code
- MQL4 - Trying to add lot size as percentage of margin to EA
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!
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 ?
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!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register