Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Question about stregies tab

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

    Question about stregies tab

    hi,
    i'm run 2 strategy(green color)....are 2 signal short..

    and follow to apply another stategy (in yellow) (ProvaLong)

    ProvaLong script :


    protected override void OnBarUpdate()
    {
    EnterLong();
    }

    i ask you 2 question :

    1) why it don't run trade ?

    2) it's possible to have for example..2 strategy long e 1 strategy short on the same futures?

    thanks
    Attached Files

    #2
    Hello esignal,

    Thank you for your post.

    If you long strategy does not have logic to exit and you are waiting until flat before taking live positions then it will not take any new positions.

    What is set for the 'Start behavior' of the long strategy? Is there any exit logic in the long strategy?

    I look forward to your response.

    Comment


      #3
      ok...
      and for the question n. 2

      2) it's possible to have for example..2 strategy long e 1 strategy short on the same futures?

      Comment


        #4
        Hello esignal,

        Thank you for your response.

        It is possible to have the strategies maintaining their own positions on the same future and account. However, the account position will reflect the actual position. For example, you have two strategies short for 1 quantity each and one strategy long for 1 quantity on the same instrument and account, then the account would reflect 1 short.

        For information on account versus strategy position please visit the following link: http://ninjatrader.com/support/helpG..._account_p.htm

        Please let me know if you have any questions.

        Comment


          #5
          another problem..

          now i've 2 strategy



          Here there is the execution



          but i don't understand what this execution refer to....
          (is missing name of strategy originally? )

          Comment


            #6
            Hello esignal,

            Thank you for your patience.

            The two Synchronize executions are to sync the account position to the strategy position, the close Position executions close the current position of the strategy, the Sell Short and Buy are entries for their respective sides.

            If you need to determine which execution belongs to which strategy you can use the Signal Names of the order functions to set a string for the orders. Then you could assign a variable to the string as well for the instance of the strategy.

            For example:
            Code:
            		protected override void OnStateChange()
            		{
            			if (State == State.SetDefaults)
            			{
            				Description									= @"Enter the description for your new custom Strategy here.";
            				Name										= "ExampleInstanceEntrySignalNameString";
            				Calculate									= Calculate.OnEachTick;
            				
            				Instance									= 1;
            			}
            		}
            
            		protected override void OnBarUpdate()
            		{
            			if (State == State.Historical) return;
            			
            			EnterLong("entry " + Instance.ToString());
            		}
            		
            		[Range(1, int.MaxValue), NinjaScriptProperty]
            		[Display(ResourceType = typeof(Custom.Resource), Name = "Instance", GroupName = "NinjaScriptParameters", Order = 0)]
            		public int Instance
            		{ get; set; }
            Please let me know if you have any questions.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            43 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            21 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            30 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            50 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            41 views
            0 likes
            Last Post CarlTrading  
            Working...
            X