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

Can I control which executions are connected with the trade lines drawn on a chart?

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

    Can I control which executions are connected with the trade lines drawn on a chart?

    I have the following custom strategy.

    Code:
    #region Using declarations
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Gui;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Gui.SuperDom;
    using NinjaTrader.Gui.Tools;
    using NinjaTrader.Data;
    using NinjaTrader.NinjaScript;
    using NinjaTrader.Core.FloatingPoint;
    using NinjaTrader.NinjaScript.Indicators;
    using NinjaTrader.NinjaScript.DrawingTools;
    #endregion
    
    //This namespace holds Strategies in this folder and is required. Do not change it. 
    namespace NinjaTrader.NinjaScript.Strategies
    {
    	public class MyCustomStrategy : Strategy
    	{	
    		protected override void OnStateChange()
    		{
    			if (State == State.SetDefaults)
    			{
    				this.Name										= "MyCustomStrategy";
    				this.Calculate									= Calculate.OnBarClose;
    				this.IsUnmanaged								= true;
    				this.BarsRequiredToTrade						= 20;
    				this.ClearOutputWindow();
    			}
    		}
    
    		protected override void OnBarUpdate()
    		{
    			if (this.CurrentBar == 25)
    				this.SubmitOrderUnmanaged(0,
    											OrderAction.Buy,
    											OrderType.Market,
    											1,
    											0,
    											0,
    											string.Empty,
    											"Entry_1");
    			
    			if (this.CurrentBar == 30)
    				this.SubmitOrderUnmanaged(0,
    											OrderAction.Buy,
    											OrderType.Market,
    											1,
    											0,
    											0,
    											string.Empty,
    											"Entry_2");
    			
    			if (this.CurrentBar == 35)
    				this.SubmitOrderUnmanaged(0,
    											OrderAction.Sell,
    											OrderType.Market,
    											1,
    											0,
    											0,
    											string.Empty,
    											"Exit_2");
    			
    			if (this.CurrentBar == 40)
    				this.SubmitOrderUnmanaged(0,
    											OrderAction.Sell,
    											OrderType.Market,
    											1,
    											0,
    											0,
    											string.Empty,
    											"Exit_1");
    		}
    	}
    }
    Can I control which executions are connected by the red and green trade lines drawn on a chart?

    For example, in the above case, I would like the trade line to connect Entry_1 and Exit_1.

    Thanks.
    Attached Files

    #2
    Hello AnotherTrader,

    Thanks for your post.

    This is possible using the Managed Approach which offers signal tracking and the ability to pair Entry signals with exits using fromEntrySignal, but since this signal tracking does not exist in the Unmanaged Approach, entries and exits are paired FIFO.

    We do have a feature request tracking interest for this item and I'll make sure a vote is added on your behalf. The ticket ID is SFT-2928.

    We collect interest in feature requests before determining if the feature should be implemented. For that reason we cannot offer an ETA. Upon implementation, the number for the ticket ID can be publicly found in the Release Notes page of the help guide. I will provide a link below.

    Release Notes - https://ninjatrader.com/support/help...ease_notes.htm

    If there is anything else we can do to assist, please don't hesitate to ask.
    JimNinjaTrader Customer Service

    Comment


      #3
      ill like to add a vote for ticket ID is SFT-2928 aswell.

      Comment


        #4
        Thanks cutzpr,

        I've added a vote on your behalf.
        JimNinjaTrader Customer Service

        Comment


          #5
          How can I vote for this?

          Comment


            #6
            Hi ManTrader, I will add a vote for you. To add a vote to any feature request, reset to add a vote and we will add one on your behalf.

            Kind regards.
            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Mestor, 03-10-2023, 01:50 AM
            16 responses
            388 views
            0 likes
            Last Post z.franck  
            Started by rtwave, 04-12-2024, 09:30 AM
            4 responses
            31 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Started by yertle, Yesterday, 08:38 AM
            7 responses
            29 views
            0 likes
            Last Post yertle
            by yertle
             
            Started by bmartz, 03-12-2024, 06:12 AM
            2 responses
            22 views
            0 likes
            Last Post bmartz
            by bmartz
             
            Started by funk10101, Today, 12:02 AM
            0 responses
            7 views
            0 likes
            Last Post funk10101  
            Working...
            X