Why does the same code result to one short and one long position simulataneously

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #148787 quote
    ibalis
    Participant
    New

    Hi,

    I have a simple code for Gold that uses a macd indicator to decide when to go long and when to go short. I am running two copies of the same code simultaneously (so for example I can stop part of my position). Today, the same code went short for one of my two positions and remained long in my other position. Both systems are running (they have not stopped). How is it possible that the same code results to one short and one long position?? They were both activated at the same time. Could it be that my order was not able to be fullfilled given the high variation in Gold price today??

     

    Many thanks,

    Yanis

    #148799 quote
    robertogozzi
    Moderator
    Master

    Strategies are unaware of one another.

    You are likely to have selected option Force Open to allow hedging, on your account settings.

    If you have, you may want to deselect it to only allow one direction.

    Within the same strategy it’s not possibie to enter two contrary positions.

    ibalis thanked this post
    #148801 quote
    ibalis
    Participant
    New

    Thanks, I have not enabled force open.

     

    I mean that the two positions shown in the image below are different (one is long and one is short) although they are using the same code (copy paste).

     

    Thanks,

    Yanis

    PRC.jpg PRC.jpg
    #148808 quote
    robertogozzi
    Moderator
    Master

    Two copies of the same strategy are DIFFERENT strategies.

    What’s in your pic is strange if hedging is not enabled.

    You should report IG this issue.

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

Why does the same code result to one short and one long position simulataneously


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
ibalis @ibalis Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzi
5 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/28/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...