Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 gravdigaz6, Today, 11:40 PM
            0 responses
            0 views
            0 likes
            Last Post gravdigaz6  
            Started by MarianApalaghiei, Today, 10:49 PM
            3 responses
            9 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by XXtrader, Today, 11:30 PM
            0 responses
            3 views
            0 likes
            Last Post XXtrader  
            Started by love2code2trade, Yesterday, 01:45 PM
            4 responses
            28 views
            0 likes
            Last Post love2code2trade  
            Started by funk10101, Today, 09:43 PM
            0 responses
            9 views
            0 likes
            Last Post funk10101  
            Working...
            X