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 1,468 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 8 posts
    2. attach_file 1 attachments




 
Search this Thread

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

  #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:	107
Size:	48.9 KB
ID:	326006  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 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: 74 since Jan 2020
Thanks Given: 23
Thanks Received: 44


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: 74 since Jan 2020
Thanks Given: 23
Thanks Received: 44

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: 74 since Jan 2020
Thanks Given: 23
Thanks Received: 44


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: 74 since Jan 2020
Thanks Given: 23
Thanks Received: 44


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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts