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 sidlercom80, 10-28-2023, 08:49 AM
            168 responses
            2,262 views
            0 likes
            Last Post sidlercom80  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by WeyldFalcon, 12-10-2020, 06:48 PM
            14 responses
            1,429 views
            0 likes
            Last Post Handclap0241  
            Started by DJ888, 04-16-2024, 06:09 PM
            2 responses
            9 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            41 views
            0 likes
            Last Post jeronymite  
            Working...
            X