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

  • NinjaTrader_PatrickH
    replied
    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.

    Leave a comment:


  • esignal
    replied
    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? )

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    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.

    Leave a comment:


  • esignal
    replied
    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?

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    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.

    Leave a comment:


  • esignal
    started a topic Question about stregies tab

    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

Latest Posts

Collapse

Topics Statistics Last Post
Started by algospoke, Yesterday, 06:40 PM
2 responses
19 views
0 likes
Last Post algospoke  
Started by ghoul, Today, 06:02 PM
3 responses
14 views
0 likes
Last Post NinjaTrader_Manfred  
Started by jeronymite, 04-12-2024, 04:26 PM
3 responses
45 views
0 likes
Last Post jeronymite  
Started by Barry Milan, Yesterday, 10:35 PM
7 responses
20 views
0 likes
Last Post NinjaTrader_Manfred  
Started by AttiM, 02-14-2024, 05:20 PM
10 responses
181 views
0 likes
Last Post jeronymite  
Working...
X