This is a quote from IG Index –
If this these two strategies were running on a live account both these trades would’ve been rejected as we will reject a trade outright if the size requested is smaller than the minimum size.
My strategy sometimes generates an order with a position size that’s less that IG’s minimum, so the trade is rejected. When that happens, PRT transfers the strategy from the Running list to the Not Running list. Can the software be amended to prevent that from happening?
Moderator’s edit: message moved from the original topic it was posted in, to become its own topic for further discussion with fellow forum members
So you want the order to be rejected when it is too small but anyway keep the strategy running? Simply something like this should do it:
if ordersize>=threshold then
buy ordersize contracts at market
endif
This way you prevent your program from trying to place a too small order and therefore it won’t be stopped…I hope. 🙂
If you calculating yourself your lot size, you can use MAX instruction to use the maximum value between 2 ones, like this:
minsize = 1 // define here yourself the minimum lot size for the current security
// launch a new order at market example (with your CalculatedLot variable)
if buycondition then
BUY MAX(minsize,CalculatedLot) CONTRACTS AT MARKET
endif
This way, the contract size should always be “minsize” (1 lot in our example) if your calculated lot size is less than “minsize”. Hope it is enough clear 🙂