NexusFi: Find Your Edge


Home Menu

 





Shifting an indicator plot?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 2 posts (3 thanks)
    2. looks_two jordis with 2 posts (0 thanks)
    3. looks_3 cory with 1 posts (1 thanks)
    4. looks_4 Big Mike with 1 posts (3 thanks)
    1. trending_up 2,142 views
    2. thumb_up 7 thanks given
    3. group 3 followers
    1. forum 6 posts
    2. attach_file 1 attachments




 
Search this Thread

Shifting an indicator plot?

  #1 (permalink)
 jordis 
Mobile, Alabama
 
Experience: Beginner
Platform: NinjaTrader, TOS
Trading: Stocks
Posts: 29 since Sep 2011
Thanks Given: 6
Thanks Received: 3

I am trying to figure out how to shift the plot of an indicator that plots as a part of a strategy in NT. Basically I just want to plot the value of the indicator for the previous bar at the current bar. It seems like this should be easy to do, but I guess I am just lost at trying to make it happen.

Basically there is a portion of my strategy that compares whether the current bar crosses above the MAX indicator from the previous bar. This isn't really an issue as far as the strategy goes, but I would also like the indicator to visually plot on the chart in this offset location.

Ideally, I would simply like to plot something like "MAX(10)[1]," but I know this doesn't really work in this simple manner. Would I have to use something like ZOrder? I have looked for information on how to use ZOrder, but the NT help guide is pretty useless when it comes to this.

I hope this is some simple "do this one thing, you idiot" sort of task, and not something that involves trying to modify indicators or anything.



Thanks for the help,
Jordis

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
36 thanks
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #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,102


I think there should be various ways of achieving it.

You could try

 
Code
protected void Initialize()
{
     ........
     Add(StrategyPlot(0));
     .......
}

protected void OnStartUp()
{
     ........
				StrategyPlot(0).Plots[0].PlotStyle = PlotStyle.Hash;
				StrategyPlot(0).Plots[0].Pen.Color = myColor;
				StrategyPlot(0).Plots[0].Pen.Width = 2;
     // or whatever you like   
     .......
}

protected void OnBarUpDate()
{
     ........
		
     if (CurrentBar) < 1
               return;
     StrategyPlot(0). Value.Set(MAX(Input,10)[1]);
     .......
}

ZOrder has nothing to do with the question. ZOrder just allows to control whether the plot will appear as the top layer (in front of the candles) or as the bottom layer (behind the candles).

Reply With Quote
Thanked by:
  #4 (permalink)
 jordis 
Mobile, Alabama
 
Experience: Beginner
Platform: NinjaTrader, TOS
Trading: Stocks
Posts: 29 since Sep 2011
Thanks Given: 6
Thanks Received: 3


Fat Tails View Post
I think there should be various ways of achieving it.

You could try

 
Code
protected void Initialize()
{
     ........
     Add(StrategyPlot(0));
     .......
}

protected void OnStartUp()
{
     ........
				StrategyPlot(0).Plots[0].PlotStyle = PlotStyle.Hash;
				StrategyPlot(0).Plots[0].Pen.Color = myColor;
				StrategyPlot(0).Plots[0].Pen.Width = 2;
     // or whatever you like   
     .......
}

protected void OnBarUpDate()
{
     ........
		
     if (CurrentBar) < 1
               return;
     StrategyPlot(0). Value.Set(MAX(Input,10)[1]);
     .......
}

ZOrder has nothing to do with the question. ZOrder just allows to control whether the plot will appear as the top layer (in front of the candles) or as the bottom layer (behind the candles).


Thanks,

With this, am I creating an indicator known as "StrategyPlot" and then initializing it within my working strategy, or am I doing all of this within the strategy itself?


I appreciate the help, and sorry for the dumb questions. I'm still learning!
jordis

Started this thread 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,102


jordis View Post
Thanks,

With this, am I creating an indicator known as "StrategyPlot" and then initializing it within my working strategy, or am I doing all of this within the strategy itself?


I appreciate the help, and sorry for the dumb questions. I'm still learning!
jordis

There are no dumb questions! This is not easy and the forum has been created to allow us to share our knowledge.

The code can be simply inserted into your strategy. This will create a strategy plot that will show on your chart, when the strategy has been activated.

Reply With Quote
Thanked by:
  #6 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608


Fat Tails View Post
There are no dumb questions!

Let's be honest. There are TONS of dumb questions But that question was not one of them...

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #7 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


Big Mike View Post
Let's be honest. There are TONS of dumb questions ....
Mike

........................................................

Attached Images
 
Reply With Quote
Thanked by:




Last Updated on January 30, 2013


© 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