NinjaTrader_Josh
07-23-2009, 11:55 AM
Reference sample for NinjaTrader 6.5.XXXX.X or greater.
Drawing objects can be used for a number of different purposes, like keeping track of where a strategy has its entry point, profit target, and stop loss. If a strategy draws an object(s) for every trade it takes, the chart could quickly become cluttered. This sample will show how to remove the objects that aren't necessary anymore.
NOTE: This is a real-time only strategy. Please view this strategy on a real-time data connection or the Simulated Data Feed.
This reference sample demonstrates the following concepts:
Drawing lines at the price where the orders are that extend for the duration of the trade
Removing those lines when the trade is over
Important methods and properties used include:
DrawLine() (http://www.ninjatrader.com/support/helpGuides/nt7/drawline.htm)
RemoveDrawObject() (http://www.ninjatrader.com/support/helpGuides/nt7/removedrawobject.htm)
Other methods and properties of interest include:
CrossAbove() (http://www.ninjatrader.com/support/helpGuides/nt7/crossabove.htm)
CrossBelow() (http://www.ninjatrader.com/support/helpGuides/nt7/crossbelow.htm)
RemoveDrawObjects() (http://www.ninjatrader.com/support/helpGuides/nt7/removedrawobjects.htm)
Import instructions for NinjaTrader 6.5.XXXX.X or greater:
Download the file contained in this thread to your PC desktop
From the Control Center window, select the menu File > Utilities > Import NinjaScript
Select the downloaded file
Drawing objects can be used for a number of different purposes, like keeping track of where a strategy has its entry point, profit target, and stop loss. If a strategy draws an object(s) for every trade it takes, the chart could quickly become cluttered. This sample will show how to remove the objects that aren't necessary anymore.
NOTE: This is a real-time only strategy. Please view this strategy on a real-time data connection or the Simulated Data Feed.
This reference sample demonstrates the following concepts:
Drawing lines at the price where the orders are that extend for the duration of the trade
Removing those lines when the trade is over
Important methods and properties used include:
DrawLine() (http://www.ninjatrader.com/support/helpGuides/nt7/drawline.htm)
RemoveDrawObject() (http://www.ninjatrader.com/support/helpGuides/nt7/removedrawobject.htm)
Other methods and properties of interest include:
CrossAbove() (http://www.ninjatrader.com/support/helpGuides/nt7/crossabove.htm)
CrossBelow() (http://www.ninjatrader.com/support/helpGuides/nt7/crossbelow.htm)
RemoveDrawObjects() (http://www.ninjatrader.com/support/helpGuides/nt7/removedrawobjects.htm)
Import instructions for NinjaTrader 6.5.XXXX.X or greater:
Download the file contained in this thread to your PC desktop
From the Control Center window, select the menu File > Utilities > Import NinjaScript
Select the downloaded file