@ Xaphod
cheers mate for the advice, I'll runthrough it now, it must be there somewhere!
@nubcake
This ea handles:
new orders - position sizing, where to enter and where to set stops
open orders - it will take partial profits @ a caluclated price (algorithm is, take the stop (e.g. 30 pips), divide by 2 (15 pips), add this to entry (1.3500+0.0015=1.35015).
and I'll check out ordermodify(OrderTicket(),...) and how it related to OrderSelect.
p.s. great work on your simulator recently
@ FXEZ
That may be it, I'll check that.
thats a great point. I hadn't considered that. I'll take a look
Cheers for all your time too guys, really appreciate it!
QuoteDislikedThen you back up to where you open the order. Print out iTicket and run GetLastError() directly after you call OrderSend(). What is going on there?
Look to see if iTicket is being reset anywhere. Search for "iTicket=" to see where it is being set.
Generally, one should always do some error checking after order related functions. Ie check the ticket nr and run GetLastError().
cheers mate for the advice, I'll runthrough it now, it must be there somewhere!
@nubcake
QuoteDislikedis this ea supposed to open orders on it's own automatically, or does it purely do some management of orders you manually open?
This ea handles:
new orders - position sizing, where to enter and where to set stops
open orders - it will take partial profits @ a caluclated price (algorithm is, take the stop (e.g. 30 pips), divide by 2 (15 pips), add this to entry (1.3500+0.0015=1.35015).
and I'll check out ordermodify(OrderTicket(),...) and how it related to OrderSelect.
p.s. great work on your simulator recently
@ FXEZ
QuoteDislikedOrderSelect also returns a boolean
That may be it, I'll check that.
QuoteDislikedNubcake's point about using the OrderTicket() function within the OrderClose() function may be where the problem lies. The other area I would look at has to do with the number of decimals with lotsTP. Your formula multiplies lots * 0.7 and this could result in a fractional number for lotsTP like 1.03423 which will cause the order to be rejected.
Try NormalizeDouble(lotsTP,2) (if your broker has a minimum lot size of 0.01) in place of lotsTP within the OrderClose function. Use the return value (true/false) from OrderClose to debug any errors....
thats a great point. I hadn't considered that. I'll take a look
Cheers for all your time too guys, really appreciate it!