Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sync

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

    Sync

    Hello,

    Doesn't matter what setting I apply, I always get the strategy position not in sync message. I have modified the settings as instructed, even added the Accountsize in the code...no luck.

    Any idea?

    Thanks!
    Tex

    #2
    Hello,

    Thank you for your post and welcome to our forums.

    Do you have live positions or orders working on your account? Is this a live account or the Sim101 account?

    Exactly what settings have you changed? Did you set Sync Account Position to True?
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hello Matthew,

      I'm still testing using Sim101.

      The settings are:
      Price=day, days to load 365, bar on close=true, min bars 20, slippage=1, entries per direc=1, stop&Target=bystrategy, sync account position=true, account size=500, order quantity=by account.

      Tex

      Comment


        #4
        Hello Tex,
        Thanks for your post and I am replying for Matthew.

        If your account is flat but if there an open position as calculated in the historical bars of the strategy then NinjaTrader will sync itself (by submitting an order) to match the account position and the strategy position if you set Sync Account Position to true.

        Please refer to our help guide to know more about it
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          I see, that's why as soon as I enable the strategy an order gets triggered immediately. How do I enable a strategy so that entry orders are placed ONLY when a condition happen?

          Comment


            #6
            Hello Tex,
            You can append the below code to stop the strategy from calculating the historical bars.

            Code:
            protected override void OnBarUpdate()
            {
            	
            	if (Historical)
            		return;
            	
                   //rest of the codes
            }
            This way your strategy will be live (with no positions) when you enable it.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              Great! Now when I place my strategy I do not get the error anymore. You Guys rock!

              Thanks.

              Comment


                #8
                Hello Tex,
                Thanks for your note.

                Please let me know if I can assist you any further.
                JoydeepNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by DavidHP, Today, 07:56 AM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by kujista, Today, 06:23 AM
                3 responses
                8 views
                0 likes
                Last Post kujista
                by kujista
                 
                Started by Mindset, Yesterday, 02:04 AM
                2 responses
                18 views
                0 likes
                Last Post NinjaTrader_RyanS  
                Started by f.saeidi, Today, 08:03 AM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by samish18, 04-17-2024, 08:57 AM
                15 responses
                53 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X