Showing a boolean series in the Market Analyzer - futures io
futures io futures trading



Showing a boolean series in the Market Analyzer


Discussion in NinjaTrader

Updated
    1. trending_up 1,774 views
    2. thumb_up 4 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Showing a boolean series in the Market Analyzer

(login for full post details)
  #1 (permalink)
California
 
 
Posts: 40 since Dec 2010
Thanks: 14 given, 3 received

Hi All

I am trying to get the output of a trendline crossing indicator (i.e. whether a line has been breached) to show up as a 1 or a 0 in the Market Analyzer. If I do it the usual way then the Analyzer thinks the trendline indicator is a normal one that just calculates without any human intervention. I think there may be a way around this by creating a Boolean data series in a primary indicator, and then using a second indicator to read in the Boolean series from the first indicator and converrt it to a plot. Is this doable or is there a smarter way ?

Thanks !!

Overview

Reply With Quote

Can you help answer these questions
from other members on futures io?
Work with historical tcks data on MUltichart NET PowerLa …
MultiCharts
Improve current ZigZag indicator in NT8
NinjaTrader
Reading A set of Trading Signals
EasyLanguage Programming
ZigZag with Depth and Backstep
EasyLanguage Programming
Help Needed: TOS Options Chain IV & IMPL MOVE Calcul …
ThinkOrSwim
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Battlestations: Show us your trading desks!
124 thanks
Big Mike in Ecuador
61 thanks
Want your NinjaTrader indicator created, free?
28 thanks
If you needed one-on-one help with any trading issue, ho …
26 thanks
Selling Options on Futures?
21 thanks
 
(login for full post details)
  #3 (permalink)
Market Wizard
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,855 since Mar 2010
Thanks: 4,238 given, 26,733 received



Overview View Post
Hi All

I am trying to get the output of a trendline crossing indicator (i.e. whether a line has been breached) to show up as a 1 or a 0 in the Market Analyzer. If I do it the usual way then the Analyzer thinks the trendline indicator is a normal one that just calculates without any human intervention. I think there may be a way around this by creating a Boolean data series in a primary indicator, and then using a second indicator to read in the Boolean series from the first indicator and converrt it to a plot. Is this doable or is there a smarter way ?

Thanks !!

Overview


There is definitely a smarter way.

The Market Analyzer (and the Strategy Builder) can only read PlotSeries. So what you need to do is to create an additional plot within your indicator. Please set that plot to Color.Transparent because you do not want to see the output on your chart. If you use Color.Transparent NinjaTrader will also not use the plot for the AutoScale property. If the plot is set to Color.Empty, the plot will not be shown, but it will affect the AutoScale properties.

The PlotSeries contains objects of type double. This is a bit luxurious for a BoolSeries, but it will solve our problem.


Attributing values to the PlotSeries

For a trendline cross you would like to know when a signal has occured. So you could for example use the following values:

-> bullish cross = 2.0 (first bar after the fast line has crossed above the slow line)
-> bullish fillter = 1.0 (all other bars when the fast line is above the slow line)
-> bearish cross = -2.0 (first bar after the fast line has crossed below the slow line)
-> bearish filter = -1.0 (all other bars when the fast line is below the slow line)

These values will not be plotted, but they can be accessed via the Market Analyzer.


Accessing the values via the Market Analyzer

I have often made bad experiences when I have checked a double for a specific value. I am only using conditions such as
 
Code
if (x == 2)
{  ; // do something}

when x is an integer. Many NinjaTrader system indicators use the formula
 
Code
if (Math.Abs (x -2) < double.Epsilon)
{  ; // do something}

instead. But this is no solution, as the error can be larger than double.Epsilon, depending on which calculations were performed. In our case we have set the value of the DataSeries field to 2, so there should be no problem checking for 2, but as a general habit, when working with objects of the data type double, I would rather check for the value being greater than 1.5, as this is not affected by any rounding error.

Reply With Quote
The following 4 users say Thank You to Fat Tails for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > Showing a boolean series in the Market Analyzer


Last Updated on September 7, 2012


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts