Thank you Eric for that link. I am really surprised that IG and PRT haven’t got this included in their manual for ProOrder programming, but at least there are some very experienced people here to help. Thank you very much.
I note that JohnMBradford’s comment above shows that others are using it. It hadn’t quite clicked with me that his comment showed a programming example. I’ll have to investigate further and see if there is any further information in the manual.
I didn’t find anything in the manual when I was puzzling over this, but I looked only because things weren’t happening as I expected. If things had worked properly the first time, I wouldn’t have thought that dealing in decimals would have necessarily needed to be in the manual.
On a slightly different note for those who deal through IG Index, it’s annoying that IG’s test system sometimes has minimum bet sizes that are different from live trades.
I’ve also found that IG’s treatment of an order generated by PRT which has a bet size below IG’s minimum (because my risk calculation required that in order to trade) for some securities places the trade at the minimum but for others rejects the trade on the grounds that my bet size is below the minimum. This is presumably a bug, but no-one seems too bothered about fixing it.
but no-one seems too bothered about fixing it.
Fixed!
minimumsize = 10
if buycondition then
buy max(minimumsize,myCalculatedSize) perpoint at market
endif
Note that the variable “myCalculatedSize” is the result of your own betsize calculation (for which I do not know anything)
Thank you, yes, I appreciate that I can amend my code to overcome the problem. My point is more that there appear to be several bugs in the system that no-one appears to be addressing, which is a worry.
LeoParticipant
Veteran
Hi, Nicolas
It will be great to close also partial positions. I know that you are a consultant to Prorealtime. That will be many of us happy if you send this suggestion.
kind Regards
@Nicolas Wanted to make sure specifying a decimal amount worked before doing it for real, it does indeed work using 1.5 GBP per point on the Dax with a simple test app.
However I was forced to put in an integer value (2 in this case) for the maximum position size which doesn’t seem correct? See attached.
Yes decimals do work, up to two decimal places max
Thanks John, I should have asked first then I wouldn’t have wasted money on a random losing test bet on the Dax :(. Looks like you are trading a really wide universe of markets and ETFs, I will have to widen my horizon I have stuck to index DFBs, Major FX pairs and Brent Crude up to now.
That extract was in the test system, but it’s far from foolproof (as yet). I trade whatever market appears to work in my system. The market itself doesn’t matter.
Seems weird … I can open a spreadbet manual trade at 0.5 perpoint on DJI, but with either of below in the code then trades open at 1 perpoint.
Anybody else get similar or any thoughts please?
Thanks
GraHal
Buy 0.50 Contracts at Market
Buy 0.50 perpoint at Market
EricParticipant
Master
min size is still 1 in proorder?
dont know why?
Thank you Eric, I’ll query / ask IG what the rationale is behind different minimum for manual and Algos.
I’ve put it on the IG Community, hoping to get a better response as it is IG moderated etc.
https://community.ig.com/t5/Platform-and-App-Technical/PRT-Pro-Order-Algo-Minimum-on-DJI-Dow/m-p/23135#M877
Nobody has replied on the IG Community but lo and behold the DJI Algo took a 0.5 Contracts Lot side about 10 minutes ago!!!!!!!
One Success … whooopppeeedddooo!!!
GraHal
Hi, does this work for backtesting? I’ve tried the code below and it does not triggers any buys, if i replace the MaxNumOfContracts in the BUY order for 1 it works, if i use 1.2 or 1.5 instead, it will still use 1. So i have two problems here:
- I don’t know why the code won’t consider valid the value of MaxNumOfContracts inside the BUY ORDER
- when manually entering decimals, it will round down (remember this is backtesting)
InitialCash=20000
Equity=InitialCash+StrategyProfit
RiskPerTrade=0.01
MaxRisk=Equity*RiskPerTrade
ContractSize=close*pipvalue
ContractRisk=ContractSize*RiskPerTRade
MaxNumOfContracts=max((round(MaxRisk/ContractRisk*100)/100),1)
/////then the buy
IF NOT LongOnMarket AND FilterCondition1 AND FilterCondition2 AND BuyCondition1 AND BuyCondition2 THEN
BUY MaxNumOfContracts CONTRACTS AT MARKET
ENDIF
Thanks!
My Algo on DJI has repeatedly executed orders at 0.5 Lots, but the window below will only accept a max at 1 Lot.