NexusFi: Find Your Edge


Home Menu

 





price marker for Draw object


Discussion in NinjaTrader

Updated
    1. trending_up 4,914 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 7 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
baberg
Canada
 
Posts: 29 since Jul 2011
Thanks Given: 4
Thanks Received: 1

Hello,

I have one DrawHorizontalLine in my script. Is it possible to get a price marker on y axis for it ? (without adding a plot/DataSeries on top of it)

Maybe with a parameter inside Initialise{} or something ?

Thanks again.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Five Days Until the Gap Dies -- CME Goes 24/7 on All Dig …
Traders Hideout
Cboe Launches BITVX Bitcoin Volatility Index and Unveils …
Prediction Markets & Event Contracts
White House Drops First Alien Files Today -- Market Says …
Prediction Markets & Event Contracts
More Than Capable: Hegseths War Warning Validates $114M …
Prediction Markets & Event Contracts
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 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
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114



baberg View Post
Hello,

I have one DrawHorizontalLine in my script. Is it possible to get a price marker on y axis for it ? (without adding a plot/DataSeries on top of it)

Maybe with a parameter inside Initialise{} or something ?

Thanks again.

I am not aware that this is possible. But why don't you want to add a plot?


Reply With Quote
  #4 (permalink)
baberg
Canada
 
Posts: 29 since Jul 2011
Thanks Given: 4
Thanks Received: 1

My aim was to get a price marker for a value calculated only on last bar.

I tried first :

if(Bars.LastBarOfSession) PlotColors[0][0]=Color.Yellow
else PlotColors[0][0]=Color.Empty

but I still got a fragment of line displayed from candle [1] to [0]


Now for the easier and valid way : if(Bars.LastBarOfSession) DataSeries ...does de job (no line at all)


Thanks again. I'll rename you officially "my coding guard"


Reply With Quote
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114


baberg View Post
My aim was to get a price marker for a value calculated only on last bar.

I tried first :

if(Bars.LastBarOfSession) PlotColors[0][0]=Color.Yellow
else PlotColors[0][0]=Color.Empty

but I still got a fragment of line displayed from candle [1] to [0]

Now for the easier and valid way : if(Bars.LastBarOfSession) DataSeries ...does de job (no line at all)

Thanks again. I'll rename you officially "my coding guard"

Sorry, I do not understand, where you want to draw a line. Also why do you want to use Bars.LastBarOfSession?

Maybe you can attach a chart and manually draw a line where you want to plot it.


Reply With Quote
  #6 (permalink)
baberg
Canada
 
Posts: 29 since Jul 2011
Thanks Given: 4
Thanks Received: 1

I wrote :
DrawHorizontalLine("tag",true,Close[0]+ATR(Close,14)[0],Color.Yellow,DashStyle.DashDot,1);
in order to get a line at LAST price level + ATR

but I needed a price marker so in the end I added a dataseries to plot yellow on top of it :
if(Bars.LastBarOfSession) marker.Set(Close[0]+ATR(Close,14)[0]);

if I didn't place if(Bars.LastBarOfSession) in front to get the marker, I'd have a zigzag line of the price+ATR for every candle on top of my horizontal line (therefore 2 lines and one I don't want at all)

Did I code it a distorded way ?! I'm a crazy aloof mind.


Reply With Quote
  #7 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114

Maybe something like this?


Attached Files
Elite Membership required to download: HorizontaLine.zip
Reply With Quote
  #8 (permalink)
baberg
Canada
 
Posts: 29 since Jul 2011
Thanks Given: 4
Thanks Received: 1

I knew it was there on purpose but which purpose. Thanks a lot.


Reply With Quote




Last Updated on August 21, 2011


© 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