Ye Gods. I am such a spoon at times.
I could not understand why others were getting the orders closing because of recrosses message but the trades were not closing. It was working fine on my machine here.
I had been testing the routine with just gbp and jpy as triggers, so I could watch the indi closely. That meant I was getting away with some incorrect coding, something that changed the moment I enabled a few more triggers.
Coders here can feel all smug and superior when I admit to coding:
instead of:
And I had the error-trapping wrong, so I was chasing the wrong error for ages.
Hey ho. We all do it from time to time.
I see there is a demand for a global DC trade closure. I have added it to V4e, so please try it out and sing out if it does not work properly. Copied from the user guide:
DC global order closure: This offers the facility to close all open positions when the Daily Cross trading profit reaches your target.
I could not understand why others were getting the orders closing because of recrosses message but the trades were not closing. It was working fine on my machine here.
I had been testing the routine with just gbp and jpy as triggers, so I could watch the indi closely. That meant I was getting away with some incorrect coding, something that changed the moment I enabled a few more triggers.
Coders here can feel all smug and superior when I admit to coding:
Inserted Code
int ticket=OrderClose(OrderTicket(),OrderLots(), Bid,10,CLR_NONE);
Inserted Code
int ticket=OrderClose(OrderTicket(),OrderLots(), MarketInfo(OrderSymbol(), MODE_BID),10,CLR_NONE);
Hey ho. We all do it from time to time.
I see there is a demand for a global DC trade closure. I have added it to V4e, so please try it out and sing out if it does not work properly. Copied from the user guide:
DC global order closure: This offers the facility to close all open positions when the Daily Cross trading profit reaches your target.
- DcGlobalOrderClosureEnabled: set this to 'true' to enable this feature, 'false' to disable.
- ProfitInDollars: set this to 'true' if you want the ea to close all orders at a set USD profit, then set DollarProfit to the figure you want.
- ProfitAsPercentageOfBalance: set this to 'true' if you want the ea to close all orders when your trading profit reaches your chosen percentage of the account balance, then set PercentageProfit to the percentage you want.
- The default settings are:
- ProfitAsPercentageOfBalance = true
- PercentageProfit = 10;
Attached File(s)
KG Relative Strength EA V4e.zip
737 KB
|
603 downloads