Contract / Position management by IG

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #193481 quote
    JS
    Participant
    Senior

    I have a (live) automatic trading system running on the US Tech 100.

    Yesterday the system went from short to long but the number of contracts did not match the settings of the system. Too few contracts were opened.

    I know that in volatile times IG adjusts certain things like the margin, but there’s enough on my account so that can’t be the problem.

    Is it perhaps the case that in volatile times IG no longer increases the margin but instead simply reduces the number of contracts by a certain percentage?

    Has anyone experienced this?

    I use a simple money management system based on margin.

    PositionSize = (STRATEGYPROFIT + prevProfit) / (Close * MarginPerc)

    #193484 quote
    GraHal
    Participant
    Master
    Too few contracts were opened
    Would not above be the case if IG increased margin % to > MarginPerc value used in your possize code above?
    #193491 quote
    JS
    Participant
    Senior

    My margin percentage in the system is fixed and based on the information from the website of IG namely 5%.

    ONCE MarginPerc = 0.05

    When IG, during the session, increases the margin percentage, it will only affect the amount of money that should be available for the margin and that money is available.

    GraHal thanked this post
    #193492 quote
    GraHal
    Participant
    Master
    Too few contracts were opened.
    Have you got the setting ‘max contracts’ set > max possize expected to be opened?
    #193493 quote
    JS
    Participant
    Senior

    Hi @GraHal

    Yes, maximum contracts are set at 10 and that is not yet the case… 😉

     

    #193494 quote
    robertogozzi
    Moderator
    Master
    What is prevProfit? STRATEGYPROFIT is updated everytime a trade is fully closed, so adding some previous profits may incorrectly increase the actual profits gained so far. The only value you could add could be the temporary current profits in case you need to accumulate positions, but it’s not safe, because those profits are not granted to stay there for the future candles.
    #193499 quote
    JS
    Participant
    Senior

    I use prevProfit when I have to stop the system (has only happened 1 time) to make a small adjustment. When you stop a system and make an adjustment, the StrategyProfit is back to zero. To take the profit from the previous session with me, I fill that in at prevProfit and start up the system again. This way your profits (or losses) are not lost.

    robertogozzi thanked this post
    #193503 quote
    robertogozzi
    Moderator
    Master
    Is it perhaps the case that in volatile times IG no longer increases the margin but instead simply reduces the number of contracts by
    Actually increasing the margin IS reducing the contracts, as it requires more money. If DAX is at 14000 and you have 12000 euros on your account, your formula, with a 5% margin, yields 17.14 contracts. If the margin is raised to 8%, you’ll get 10.71 contracts, instead.
    #193505 quote
    JS
    Participant
    Senior

    As you know, there is no exchange of data between your account and your strategy.

    The strategy doesn’t know how much is on my account and he doesn’t know a lot of other things either like minimum stopping distance, minimum contract size, etc.

    All this data has to be incorporated into your strategy with ONCE.

    The amount of money in my account is sufficient and my minimum contract size starts at 1 and on the basis of the StrategyProfit it is built up.

    #193509 quote
    JS
    Participant
    Senior

    It’s really annoying and incomprehensible that when I make more profit that IG reduces my positions. This totally undermines my confidence in automatic trading.

    #193510 quote
    GraHal
    Participant
    Master
    Does the same trade / same time in backtest and or Forward test on Demo live data produce the desired possize?
    #193514 quote
    JS
    Participant
    Senior

    Yes, when I perform a backtest from the date the system is activated, it does show the correct position size.

    #193519 quote
    robertogozzi
    Moderator
    Master
    I have no other clues, nor ideas about the causes. I think only addressing PRT could work it out!
    JS thanked this post
    #193525 quote
    GraHal
    Participant
    Master
    when I perform a backtest
    Might be worth setting up a Forward Test on Demo Account running on Live data and compare results with what you see on your Live Account running on Live data?
    JS thanked this post
    #193531 quote
    PeterSt
    Participant
    Master
    @JS, Notice that if you are literally inverting (thus be 10 long,go 20 short, which would be the same as sell 10 and next sell short 10 in the same bar (call of your code)) then you would need 20 contracts. This is only a fraction of a second (nothing knows that you will be trading in the 20 net contracts for 10 others to vanish) – this is how it works.
Viewing 15 posts - 1 through 15 (of 25 total)
  • You must be logged in to reply to this topic.

Contract / Position management by IG


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
JS @js Participant
Summary

This topic contains 24 replies,
has 4 voices, and was last updated by PeterSt
3 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/20/2022
Status: Active
Attachments: No files
Logo Logo
Loading...