NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Educational Resources > Reference Samples

Reference Samples Official NinjaScript reference code samples

Reply
 
Thread Tools Display Modes
Old 04-05-2008, 10:20 PM   #1
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default Strategy: Plotting from within a NinjaScript Strategy

When running a strategy on a chart you may find the need to plot values onto a chart. If these values are internal strategy calculations that are difficult to migrate to an indicator, you can use the following technique to achieve a plot. The technique involves the use of a custom indicator, StrategyPlot(), that is included in the import.

Note: This technique has limited functionality. It will NOT work for charts in the Strategy Analyzer during backtesting, but it will work on real-time charts.

This reference sample demonstrates the following concept:
  • Set values to a blank indicator from a strategy
  • Plot multi-time/instrument values
Important methods and properties used include: Other methods and properties of interest include:
  • Pen.Width
  • Pen.DashStyle
Import instructions:
  1. Download the file contained in this thread to your PC desktop
  2. From the Control Center window, select the menu File > Utilities > Import NinjaScript
  3. Select the downloaded file
Attached Files
File Type: zip SampleStrategyPlot.zip (2.8 KB, 2524 views)
NinjaTrader_Josh is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Josh for this post:
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Strategy Defaults for Ninjascript Strategy dendy Strategy Development 2 03-28-2008 03:32 PM
Plotting Trade Executions from Strategy Learning1 Charting 2 11-20-2007 02:15 PM
Ending Ninjascript strategy jlm0@infionline.net General Programming 50 11-14-2007 10:59 PM
NinjaScript Strategy Wizard crazyhorse2393 Automated Trading 3 10-29-2007 06:47 AM
Plotting Strategy Equity Curve on Chart whitmark Strategy Development 1 06-04-2007 05:25 PM


All times are GMT -6. The time now is 12:37 PM.