• 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

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Tradarr, Today, 06:25 PM
        2 responses
        5 views
        0 likes
        Last Post Tradarr
        by Tradarr
         
        Started by cocopod, Today, 04:47 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_JoshG  
        Started by digibob, Today, 02:47 AM
        2 responses
        14 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by mntemel, Today, 03:31 PM
        4 responses
        21 views
        0 likes
        Last Post mntemel
        by mntemel
         
        Started by mrlucky1x, Today, 03:14 PM
        2 responses
        7 views
        0 likes
        Last Post mrlucky1x  
        Working...
        X