I'm trying to use the DrawRay() method in a NinjaScript class to draw lines on a chart like so;
[FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=black]IRay ray = DrawRay("tag1", 10, 1000, 0, 1001, Color.LimeGreen)[/COLOR][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT]
but on compilation I get the error
"The name DrawRay does not exist in the current context"
I have the following using statements at the top of the code
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#000000] System;[/COLOR][/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#000000] System.ComponentModel;[/COLOR][/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#000000] System.Diagnostics;[/COLOR][/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#000000] System.Drawing;[/COLOR][/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#000000] System.Drawing.Drawing2D;[/COLOR][/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#000000] System.Xml.Serialization;[/COLOR][/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#000000] NinjaTrader.Cbi;[/COLOR][/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#000000] NinjaTrader.Data;[/COLOR][/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#000000] NinjaTrader.Gui.Chart;[/COLOR][/SIZE][/FONT] [/SIZE][/FONT]
[FONT=Calibri][COLOR=#000000]Assembly[/COLOR][/FONT][FONT=Calibri][COLOR=#000000]System.dll[/COLOR][/FONT][FONT=Calibri][COLOR=#000000]System.Core.dll[/COLOR][/FONT][FONT=Calibri][COLOR=#000000]System.Drawing.dll[/COLOR][/FONT][FONT=Calibri][COLOR=#000000]System.Windows.Forms.dll[/COLOR][/FONT][FONT=Calibri][COLOR=#000000]System.XML.dll[/COLOR][/FONT][FONT=Calibri][COLOR=#000000]C:\Program Files (x86)\NinjaTrader 7\bin\NinjaTrader.Core.dll[/COLOR][/FONT][FONT=Calibri][COLOR=#000000]C:\Program Files (x86)\NinjaTrader 7\bin\WilsonORMapper.dll[/COLOR][/FONT][FONT=Calibri][COLOR=#000000]C:\Users\UserName\Documents\NinjaTrader 7\bin\Custom\NinjaTrader.Vendor.dll[/COLOR][/FONT]
Given that this is a Class definition and not an indicator is it possible to use the NinjaScript drawing objects in the way I propose. Have I missed a reference or using statement? Do I need to declare an Interface in some way? Could someone please show me how to use this drawing object.
Thanks
Comment