NexusFi: Find Your Edge


Home Menu

 





price marker for Draw object


Discussion in NinjaTrader

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




 
Search this Thread

price marker for Draw object

  #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?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
What broker to use for trading palladium futures
Commodities
 
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103



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, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


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, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103

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


© 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