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 Powerbucker, Yesterday, 05:09 PM
            2 responses
            14 views
            0 likes
            Last Post Powerbucker  
            Started by DerkWehler, 11-27-2024, 11:56 AM
            16 responses
            50 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by MikM45, Today, 03:10 AM
            2 responses
            9 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by londonby, 10-31-2024, 03:09 PM
            2 responses
            42 views
            0 likes
            Last Post KenyaFuentes  
            Started by ezrollin, 02-26-2022, 11:14 PM
            14 responses
            305 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X