• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 behindthewheel, Today, 10:39 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Jim  
            Started by Newtrader101, Today, 10:46 AM
            3 responses
            8 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Started by tecmisc1, Today, 10:42 AM
            1 response
            8 views
            0 likes
            Last Post tecmisc1  
            Started by ballboy11, Today, 10:35 AM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Kate  
            Started by fredfred, Today, 10:30 AM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_Melissa  
            Working...
            X