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 memonic, Yesterday, 01:23 PM
            2 responses
            12 views
            0 likes
            Last Post memonic
            by memonic
             
            Started by merc410, Today, 03:41 AM
            2 responses
            13 views
            0 likes
            Last Post merc410
            by merc410
             
            Started by sugalt, 04-30-2024, 04:02 AM
            2 responses
            13 views
            0 likes
            Last Post sugalt
            by sugalt
             
            Started by Ndakotan1313, 03-14-2024, 05:02 PM
            2 responses
            64 views
            0 likes
            Last Post blaise_code  
            Started by claxxical, 05-30-2017, 12:30 PM
            37 responses
            4,465 views
            0 likes
            Last Post Padan
            by Padan
             
            Working...
            X