Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I have a 3rd party indicator that I would like to make strategy entries from. It does not generate plots or and bool conditions just a DrawSquare object on the chart. I know its possible to detect these. Does anyone know how?
Thanks
Westsider
Can you help answer these questions from other members on NexusFi?
Not sure if this will meet your needs but from the Ninja help file:
NinjaScript > Language Reference > Drawing >
DrawObjects
Definition
A collection holding all of the draw objects on the chart for the primary bar series. The draw objects can be manually drawn or script generated objects.
Property Value
A collection of IDrawObject objects.
Syntax
DrawObjects
DrawObjects[string tag]
DrawObjects.Count
Examples
// Example #1: Finding the draw object of a specific tag
protected override void OnBarUpdate()
{
if (DrawObjects["someTag"] != null && DrawObjects["someTag"].DrawType == DrawType.Line)
{
// Do something
}
}
// Example #2: Number of draw objects on a chart
protected override void OnBarUpdate()
{
if (DrawObjects.Count == 3)
{
// Do something
}
}
// Example #3: Looping through the collection to find specific draw objects
protected override void OnBarUpdate()
{
// Loops through the DrawObjects collection
foreach (IDrawObject draw in DrawObjects)
{
// Finds line objects that are attached globally to all charts of the same instrument
if (draw.Tag.StartsWith("@") && draw is ILine)
{
ILine globalLine = (ILine) draw;
// Changes the line color and prints its starting and end points