I'm struggling to work out why the strategy tester will not allow my EA to place a trade greater than £50/pip. It runs on an IG DEMO account strategy tester fine upt to £49/pip but the moment the EA calls for a pip rate of greater than £50/pip it comes back with an invalid trade volume.
I will include the place trade section of my EA in the next post, nothing special about it and this is what causes an error 131 to be returned. The moment the lot size is restricted to £50/pip or less the trade is placed absolutely fine.
Does anybody have any ideas why this might happen???
if(CalcCandle>=TradeStartTime && CalcCandle<GoodTillCancelled && OrderTradeType!=0 && DayTradeActive=="No" && RunningTicketCounter<MaxTrades)
ticket = OrderSend(Symbol(),OpType,lots,NormalizeDouble(TradeBidPrice,Digits),30*pips,0,0,"Trade Placed By the EA Script.",1234,0,Magenta);
err = GetLastError();
Print("Encountered an error during modification of the placed order, the pending trade has no tp or sl!"+err+" "+ErrorDescription(err) );
Print("Order placed and modified successfully pending order set to 1");
err = GetLastError();
Print("Encountered an error during order placement!"+err+" "+ErrorDescription(err) );
if(err==ERR_TRADE_NOT_ALLOWED)MessageBox("You can not place a trade because \"Allow Live Trading\" is not checked in your options. Please check the \"Allow Live Trading\" Box!","Check Your Settings!");
Have you checked MarketInfo MODE_MAXLOT ?
PS if you want people to help you, please do not post such wide sections of code in future. It makes the post difficult to read.
Thankyou GumRai, appreciate the advice. As it turns out I arrived at the same result late last night MODE_MAXLOT, annoying for me since I knew of MODE_MINLOT!!!
So as it turns out the IG DEMO account allows lot sizes of 0.1 to 50 hence my issue. The IG LIVE account allows lotsizes of 1 to 500, BUT for some reason I can't get the strategy Tester to work on the LIVE account, when I go to the History Center it won't download any 1minute data from Metacorp :o(
I've tried tasking the HST from the DEMO account history folder and pasting into the LIVE history folder but that doesn't see to fix the issue either.
To add comments, please log in or register