Hi
An easy question to you pros;>)
I want to trade positionsize in relation to the growth ( I hope) of my account
like this
V = variabel
positionsize = account/ V * 10.000
this would produce X contracts which I then want reduced to 2 decimals, for instance 2.57 which I suppose is the most decimals PRT accepts?
ex= account 128.527
V = 5
positionsize = 2.57
I don’t know how many decimal digits are allowed in automatic trading. to make sure there are no miore than 2 decimal digits you can write:
N = close / 10000
X = round((N * 100) - 0.5) / 100 //max 2 decimal places
Y = round((N * 10) - 0.5) / 10 //max 1 decimal place
Hi Roberto
I found this in another tread
STARTINGCAPITAL = 10000 //10k USD
SIZE = 1 / STARTINGCAPITAL //divide your initial contract size by startingcapital
CAPITAL = STARTINGCAPITAL + STRATEGYPROFIT //current capital
K = CAPITAL * SIZE //calculate position size
positionsize=K
N = close / 10000
X = round((N * 100) - 0.5) / 100//max 2 decimal places
So this do you think will work?
It is answer to the first part of my question above.
Is there anyone here who knows how many decimals IG requires in an automated trading?
OMXet – Please follow the forum rules and always use the ‘Insert PRT Code’ button when posting code. I have tidied up your post.
Probably the best people to ask about how many decimal places IG allow is IG.
Years ago it used to be that only whole numbers were allowed by IG and any orders with decimals were rejected but that definitely changed at some point.
Hi Vonasi
Sorry, I didn’t know about that rule. But I know now so it will not happen again ;>)
Yep, I will ask IG too
I had an Algo last week showing a position size of 0.93 contracts on the DJI in Demo.
Minimum on the DJI is 0.2 so it looks like above 0.2 to decimal places may be allowed.
You could always ask on the IG Forum
https://community.ig.com/forums/?ct=1589816729
Hi Grahal
Yes I know that multipel decimals work in Demo but how about Live???