Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Position status and position qty when flat are not identified well

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Position status and position qty when flat are not identified well

    hi

    i created new superdom columns script

    which works fine

    however within this script i wrote :


    protected override void OnPositionUpdate(PositionEventArgs positionUpdate)
    {



    Print("MarketPosition " + positionUpdate.Position.MarketPosition.ToString()) ;

    Print(" position QTY" + positionUpdate.Position.Quantity.ToString());


    }

    if found that when i enter position with 1 contract long

    MarketPosition is long and position QTY is 1

    when i increase position i.e. buy one more contract

    MarketPosition is long and position QTY is 2

    when i exist 1 contract ( decrease position )

    MarketPosition is long and position QTY is 1

    so far all is good

    BUT !!

    when i exist 1 contract more ( decrease position , expect to become flat )

    MarketPosition is long and position QTY is 1

    i.e. when position is accually flat it is reported as long with quantity 1

    i want to make clear that the super dom report on position as it should
    but inside my script the position situation is not identified correctly

    #2
    Hello doron,

    Thank you for your post.

    How are you checking the Position and Quantity in the script? In what method are you checking the values? Is this on the execution report in OnExecutionUpdate()?

    Do you have a sample script or a piece of code we may test on our end to see the same behavior?

    Comment


      #3
      as i wrote
      i print in the script
      and compair results to DOM
      and i know when i am flat or not

      Comment


        #4
        Hello doron,

        As you have not supplied any code I cannot say anything other then what I previously posted. I would add that you can look to the Super Dom Columns methods, but I assume you are already using these?

        Comment


          #5
          the code was and is still in the 1st post i published
          just copy and past it

          Comment


            #6
            Thanks doron,

            You would want to use positionUpdate.MarketPosition. This will pull the position of the account rather than the Position object and then the MarketPosition. I will forward to Product Management as they are updating the documentation.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by GussJ, 03-04-2020, 03:11 PM
            16 responses
            3,279 views
            0 likes
            Last Post Leafcutter  
            Started by WHICKED, Today, 12:45 PM
            2 responses
            19 views
            0 likes
            Last Post WHICKED
            by WHICKED
             
            Started by Tim-c, Today, 02:10 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Taddypole, Today, 02:47 PM
            0 responses
            5 views
            0 likes
            Last Post Taddypole  
            Started by chbruno, 04-24-2024, 04:10 PM
            4 responses
            51 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Working...
            X