Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

number of contracts exceeding settings.

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

    number of contracts exceeding settings.

    This code is trading 3 different contracts even though the setting are for only one??


    private int postionSizeA = 1; // Default setting for PosItionSize
    private int postionSizeB = 0; // Default setting for PostionSize
    private int postionSizeC = 0; // Default setting for PostionSize



    [Description("X")]
    [GridCategory("X")]
    public int PostionSizeA
    {
    get { return postionSizeA; }
    set { postionSizeA = Math.Max(0, value); }
    }
    [Description("X")]
    [GridCategory("X")]
    public int PostionSizeB
    {
    get { return postionSizeB; }
    set { postionSizeB = Math.Max(0, value); }
    }
    [Description("X")]
    [GridCategory("X")]
    public int PostionSizeC
    {
    get { return postionSizeC; }
    set { postionSizeC = Math.Max(0, value); }
    }

    #2
    Hello,

    Thanks for the post.

    Would need more information then the what was provided. Such as if this a multi data series strategy?

    What code are you using for the entry's? Do you call it multiple times?

    What do you set Entried Per Direction too when you start the strategy with the strategy settings on start?

    I look forward to assisting you further.

    Comment


      #3
      Thanks for the quick reply:


      EnterLong(positionSizeA, "1longA");
      EnterLong(positionSizeB, "1longB");
      EnterLong(positionSizeC, "1longC");


      Entries per direction is set at one...

      perhaps that is the issue. if it is, how do I control the setting in a strategy?

      Comment


        #4
        HI mainstream,

        That setting works closely with EntryHandling.

        If EntriesPerDirection is set to 1 and EntryHandling is unique entries, then it accepts 1 entry per direction for each uniquely named rule. In your example it can then enter up to 3 times. If you want it to accept 1 entry per direction for all signals, change EntryHandling to AllEntries.

        Also- You can't use quantity of 0 for your order methods. NinjaTrader will substitute 1 instead.


        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          I understand. Thank you. That then leads to a question about targets for each unique entry.... how would one achieve unique targets if you enter with 3 contracts without expressly designating each entry with a different identity?

          Comment


            #6
            Hello,

            You can simply just scale out, ExitLong you can define a QTY. Call this as many times as you need until you are flat and what points you want to call it.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kevinenergy, 02-17-2023, 12:42 PM
            117 responses
            2,765 views
            1 like
            Last Post jculp
            by jculp
             
            Started by Mongo, Today, 11:05 AM
            5 responses
            15 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by SightCareAubetter, Today, 12:55 PM
            0 responses
            3 views
            0 likes
            Last Post SightCareAubetter  
            Started by traderqz, Today, 12:06 AM
            8 responses
            16 views
            0 likes
            Last Post traderqz  
            Started by SightCareAubetter, Today, 12:50 PM
            0 responses
            2 views
            0 likes
            Last Post SightCareAubetter  
            Working...
            X