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 Mindset, 04-21-2026, 06:46 AM
            0 responses
            93 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            138 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            68 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            123 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            73 views
            0 likes
            Last Post PaulMohn  
            Working...
            X