View Full Version : Plot Line Length
ozfader
07-12-2008, 10:40 AM
Can anyone please tell me how I can add a user defined parameter to plot a specific length for the PriorOHLC and CurrentOHL horizontal lines and add a text label eg. PH to PrevHigh?
Thanks.
NinjaTrader_Josh
07-12-2008, 01:29 PM
You would want to use DrawText() (http://www.ninjatrader-support.com/HelpGuideV6/DrawText.html) for your text. Adjust the y and yPixelOffset values to tell it where you want it to draw.
To get a line that is not indefinite use DrawLine() (http://www.ninjatrader-support.com/HelpGuideV6/DrawLine.html). You can input the start and end bars. Keep the y values the same at start and end to get a horizontal line.
ozfader
07-12-2008, 08:04 PM
Appreciate your response Josh...
For a total programming newbie, can you please explain just where in the code these lines should be placed. I've had numerous attempts but they won't compile.
NinjaTrader_Josh
07-12-2008, 11:39 PM
Generally inside the OnBarUpdate() method. Unfortunately it is not that cut and dry though, but hopefully that is enough to get you going. Due to bandwidth reasons we cannot program these for you, but if you wish you can also try contacting one of the NinjaScript Consultants here: http://www.ninjatrader.com/webnew/partners_onlinetrading_NinjaScript.htm