NexusFi: Find Your Edge


Home Menu

 





Parallel Lines


Discussion in NinjaTrader

Updated
    1. trending_up 1,754 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: NQ / ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,801 since Aug 2009
Thanks Given: 11,742
Thanks Received: 3,018

How can I draw parallel extended lines with NinjaScript?

I've checked the NT forum and not much help was found there.

Thanks


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on X Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
CFTC Rewrites the Rulebook -- Kalshi Cracks $1B Non-Spor …
Prediction Markets & Event Contracts
April FOMC Minutes: Most Divided Fed Since 1992 -- Many …
Traders Hideout
$12M Ceasefire Contract Goes Disputed as Bandar Abbas St …
Prediction Markets & Event Contracts
Probability Collapse: Bitcoin $150k Craters from 15% to …
Prediction Markets & Event Contracts
Asia Equities Crash Overnight -- Nikkei -5.2%, KOSPI -6. …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Hello Im new here
5 thanks
  #3 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 2,947 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,860



DavidHP View Post
How can I draw parallel extended lines with NinjaScript?

I've checked the NT forum and not much help was found there.

Thanks

You can either use the :

DrawTrendChannel("tag1", true, 10, Low[10], 0, High[0], 10, High[10] + 5 * TickSize);

Or you calculate the Angle yourself and draw individual lines that are parallel


Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: NQ / ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,801 since Aug 2009
Thanks Given: 11,742
Thanks Received: 3,018


rleplae View Post
You can either use the :

DrawTrendChannel("tag1", true, 10, Low[10], 0, High[0], 10, High[10] + 5 * TickSize);

Or you calculate the Angle yourself and draw individual lines that are parallel

Thanks for the suggestion.
I would rather draw the lines myself but the problem is calculating the angle.

I tried using the DrawTrendChannel method and the issue is that method does not allow the lines to be colored differently.
I also tried the DrawAndrewsPitchfork and the line color can be changed but only as a group not individually (Top/bottom)

Drawing angles seems to not work the ways I have tried.
I have no issue drawing a trend line from tops or from bottoms but the angle calculating is not something I have been successful at accomplishing.

Here is what I tried but the lines are not parallel.

 
Code
DrawRay("rayLow", true, CurrentBar-prevlobar, prevlo, CurrentBar-lastlobar, lastlo, Color.Green, DashStyle, 4);

DrawRay("rayHigh", true, CurrentBar-prevhibar, prevhi, CurrentBar-lastlobar,(lastlo+(prevhi-prevlo)), Color.Red, DashStyle, 4);
Thank you for your input.


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on X Started this thread Reply With Quote
  #5 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 2,947 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,860


DavidHP View Post
Thanks for the suggestion.
I would rather draw the lines myself but the problem is calculating the angle.

I tried using the DrawTrendChannel method and the issue is that method does not allow the lines to be colored differently.
I also tried the DrawAndrewsPitchfork and the line color can be changed but only as a group not individually (Top/bottom)

Drawing angles seems to not work the ways I have tried.
I have no issue drawing a trend line from tops or from bottoms but the angle calculating is not something I have been successful at accomplishing.

Here is what I tried but the lines are not parallel.

 
Code
DrawRay("rayLow", true, CurrentBar-prevlobar, prevlo, CurrentBar-lastlobar, lastlo, Color.Green, DashStyle, 4);

DrawRay("rayHigh", true, CurrentBar-prevhibar, prevhi, CurrentBar-lastlobar,(lastlo+(prevhi-prevlo)), Color.Red, DashStyle, 4);
Thank you for your input.

TGIF

This is basis trigonometry
explained by a beautiful lady always soften to digest


Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #6 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: NQ / ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,801 since Aug 2009
Thanks Given: 11,742
Thanks Received: 3,018

Thanks for the link I will watch it when I get in this afternoon.

None of this is critical.
The line colors are simply cosmetic and the TrendChannel or Andrews is sufficient.

However, when I tried to do it myself I found I did not understand the concept and that is always a challenge.
So I will learn the concept and be able to do it.

I figured it was a little complicated since everyone that asked on the NT forum was given vague answers and told it was an advanced concept. That type of response always makes me want to find out more. Kind of like saying "this is too difficult for you to understand" Hmm.

Thanks again.


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on X Started this thread Reply With Quote




Last Updated on August 18, 2017


© 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