Positionsize vs accountcapital

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #163994 quote
    OMXet
    Participant
    Junior

    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

    #164023 quote
    robertogozzi
    Moderator
    Master

    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
    #164101 quote
    OMXet
    Participant
    Junior

    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?

    #164119 quote
    Vonasi
    Moderator
    Master

    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.

    Insert-PRT-Code-Button.png Insert-PRT-Code-Button.png
    #164121 quote
    OMXet
    Participant
    Junior

    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

    #164122 quote
    GraHal
    Participant
    Master

    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

    #164123 quote
    OMXet
    Participant
    Junior

    Hi Grahal

     

    Yes I know that multipel decimals work in Demo but how about Live???

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Positionsize vs accountcapital


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
OMXet @omxet Participant
Summary

This topic contains 6 replies,
has 4 voices, and was last updated by OMXet
4 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/13/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...