NexusFi: Find Your Edge


Home Menu

 





is there a tool to draw lines automatically in ninja trader 8?


Discussion in NinjaTrader

Updated
    1. trending_up 2,865 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 8 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
LineBreak
Hamburg Germany
 
Posts: 7 since May 2022
Thanks Given: 6
Thanks Received: 1

hello together.

is there a tool available which let me draw lines automatically in ninja trader 8?


i want to draw a initial line(by hand) and the tool should automatically draw a line in 20 points plus and in 30 points plus. also it should draw a line with 90 points minus.

also it should do it vice versa. minus 20 points, minus 30 points and plus 90 points.

so that i can use hotkeys for plus and a hotkey for minus lines.

bonus:

it let me choose which color the lines have.

here is a picture for clarification.


thx in advance.

edit: i cant post picture, sorry.

but you should get the point.


Attached Thumbnails
Click image for larger version

Name:	Screenshot_99.png
Views:	196
Size:	48.9 KB
ID:	326006  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
March Jobs Report Update: 178K Beat vs 59K Expected, Wag …
Traders Hideout
Iran Ceasefire Surges to 19.5% on US 15-Point Plan -- 82 …
Prediction Markets & Event Contracts
Iran Airspace Collapses 18 Points to 15.5% While Hormuz …
Prediction Markets & Event Contracts
Eurex Eyes Prediction Markets -- Europes Biggest Derivat …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 thanks
  #2 (permalink)
LineBreak
Hamburg Germany
 
Posts: 7 since May 2022
Thanks Given: 6
Thanks Received: 1

anyone?


Reply With Quote
  #3 (permalink)
 SamirOfSalem   is a Vendor
 
Posts: 77 since Jan 2020
Thanks Given: 23
Thanks Received: 49


See if this helps:

https://ninjatraderecosystem.com/user-app-share-download/repeater/


Reply With Quote
Thanked by:
  #4 (permalink)
LineBreak
Hamburg Germany
 
Posts: 7 since May 2022
Thanks Given: 6
Thanks Received: 1


SamirOfSalem View Post
See if this helps:

thank you for the link.

sadly the explantation video isnt loading cause its using the flash player.

i also didnt find any information how to use the tool.

i downloaded the zip and installed the indicator.

but i have no clue how to use it in the chart.

did you know how to use?


Reply With Quote
  #5 (permalink)
 SamirOfSalem   is a Vendor
 
Posts: 77 since Jan 2020
Thanks Given: 23
Thanks Received: 49

Hi. There are many ways to use it. For your requirement, I'd maybe do this:

Apply indicator to chart, for Event 1 and Event 2 select "Price Range", and enter the same Start Price
For event 1 make the End Price 20 points away
For event 2 make the End Price 90 points away

For the negatives, apply a second instance of the indicator and use subtraction instead.

Otherwise if you're into coding, create a new drawing tool and derive it from the Line drawing class, then edit On Render to draw the additional lines at the required price differences.


Reply With Quote
Thanked by:
  #6 (permalink)
LineBreak
Hamburg Germany
 
Posts: 7 since May 2022
Thanks Given: 6
Thanks Received: 1


SamirOfSalem View Post

Otherwise if you're into coding, create a new drawing tool and derive it from the Line drawing class, then edit On Render to draw the additional lines at the required price differences.

thx mate. i appreciate.

yes, i think i will let someone code me something. the tool you suggested ist to complex.

its need to be faster without giving in parameters. simply click at the pricerange and set the lines automatically.

will find a solution.


Reply With Quote
  #7 (permalink)
 SamirOfSalem   is a Vendor
 
Posts: 77 since Jan 2020
Thanks Given: 23
Thanks Received: 49


LineBreak View Post
thx mate. i appreciate.

yes, i think i will let someone code me something. the tool you suggested ist to complex.

its need to be faster without giving in parameters. simply click at the pricerange and set the lines automatically.

will find a solution.

You need a percentage or a fixed increment?


Reply With Quote
  #8 (permalink)
LineBreak
Hamburg Germany
 
Posts: 7 since May 2022
Thanks Given: 6
Thanks Received: 1


SamirOfSalem View Post
You need a percentage or a fixed increment?

fixed. 20 and 30 points. positive for longs, negative for shorts.


Reply With Quote
  #9 (permalink)
 SamirOfSalem   is a Vendor
 
Posts: 77 since Jan 2020
Thanks Given: 23
Thanks Received: 49


LineBreak View Post
fixed. 20 and 30 points. positive for longs, negative for shorts.

Here's a quick re-hash of NinjaTrader's built-in Horizontal Line to get you started:

 
Code
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
using NinjaTrader.Gui;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Core.FloatingPoint;

//This namespace holds Drawing tools in this folder and is required. Do not change it. 
namespace NinjaTrader.NinjaScript.DrawingTools
{
    public class fioHamburgHorizontals : HorizontalLine
    {
        public Stroke StrokeForPluses { get; set; }
        public Stroke StrokeForMinuses { get; set; }
        public ChartAnchor ExtraAnchor { get; set; }
        
        protected override void OnStateChange()
        {
            base.OnStateChange();
            if (State == State.SetDefaults)
            {
                Name = "fio Hamburg Horizontals";

                ExtraAnchor = new ChartAnchor();
                StrokeForMinuses = new Stroke(Brushes.Red);
                StrokeForPluses = new Stroke(Brushes.Green);
            }
        }

        public override void OnRender(ChartControl chartControl, ChartScale chartScale)
        {
            base.OnRender(chartControl, chartScale);

            ChartPanel panel = chartControl.ChartPanels[chartScale.PanelIndex];
            
            foreach (var x in  new List<int>{ -90, -30, -20, 20, 30, 90 })
            {
                Stroke ExtraStroke = new Stroke();
                if (x < 0) StrokeForMinuses.CopyTo(ExtraStroke); else StrokeForPluses.CopyTo(ExtraStroke);

                ExtraStroke.RenderTarget = RenderTarget;
                double strokePixAdj = ((double)(ExtraStroke.Width % 2)).ApproxCompare(0) == 0 ? 0.5d : 0d;
                Vector pixelAdjustVec = new Vector(strokePixAdj, strokePixAdj);
                
                StartAnchor.CopyTo(ExtraAnchor);
                ExtraAnchor.Price = StartAnchor.Price + x;
                Point extraPoint = ExtraAnchor.GetPoint(chartControl, panel, chartScale);

                Point startAdj = new Point(panel.X, extraPoint.Y) + pixelAdjustVec;
                Point endAdj = new Point(panel.X + panel.W, extraPoint.Y) + pixelAdjustVec;

                RenderTarget.DrawLine(startAdj.ToVector2(), endAdj.ToVector2(), ExtraStroke.BrushDX, ExtraStroke.Width, ExtraStroke.StrokeStyle);
            }
        }

    }
}


Reply With Quote
Thanked by:




Last Updated on July 27, 2022


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts