• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Method to determinate MarketPositions in NT8

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

    Method to determinate MarketPositions in NT8

    In NT7 was method work perfect.

    System.Collections.ObjectModel.Collection<Position > pc = accountCurrent.Positions;
    int count_pos = 0;
    string pos_side = "Flat";

    foreach (Position pos in pc)
    {
    if (pos.Instrument.FullName == Instrument.FullName)
    {
    count_pos = pos.Quantity;
    pos_side = pos.MarketPosition.ToString();
    break;
    }
    }
    In NT8 it is not work perfect

    Please help determinate MarketPositions in NT8

    #2
    Originally posted by Daniel11 View Post
    In NT7 was method work perfect.

    System.Collections.ObjectModel.Collection<Position > pc = accountCurrent.Positions;
    int count_pos = 0;
    string pos_side = "Flat";

    foreach (Position pos in pc)
    {
    if (pos.Instrument.FullName == Instrument.FullName)
    {
    count_pos = pos.Quantity;
    pos_side = pos.MarketPosition.ToString();
    break;
    }
    }
    In NT8 it is not work perfect

    Please help determinate MarketPositions in NT8
    Use the exposed Account class directly.

    ref: http://ninjatrader.com/support/helpG...ount_class.htm

    Comment


      #3
      One steep delay

      I did same code.
      But it getting one steep delay.
      Can you fix this error in NT8 code

      Comment


        #4
        Hello Daniel11,

        Thank you for writing in.

        I would suggest taking a look at the PositionUpdate help guide section at this link: https://ninjatrader.com/support/help...tionupdate.htm

        This page provides sample code that you can use to obtain account positions.

        Can you please clarify what you mean by getting a delay?
        Zachary G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ttodua, Today, 06:47 AM
        0 responses
        1 view
        0 likes
        Last Post ttodua
        by ttodua
         
        Started by Derjan, Today, 03:09 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by usero86, Today, 04:28 AM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by bohenriksen, Today, 04:00 AM
        0 responses
        8 views
        0 likes
        Last Post bohenriksen  
        Started by CDXTrader, Today, 12:29 AM
        0 responses
        11 views
        0 likes
        Last Post CDXTrader  
        Working...
        X