Creating a Coupling/Decoupling Chart - Help Needed! - NinjaTrader | futures io social day trading
futures io futures trading


Creating a Coupling/Decoupling Chart - Help Needed!
Updated: Views / Replies:538 / 6
Created: by JustinIsHere Attachments:0

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

Creating a Coupling/Decoupling Chart - Help Needed!

  #1 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Beginner
Platform: NinjaTrader, Multicharts
Favorite Futures: ES
 
Posts: 96 since Dec 2011
Thanks: 46 given, 84 received

Creating a Coupling/Decoupling Chart - Help Needed!

So far, I've come up with this result:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


I would like to invert the price on one of either instrument in order to create a correlation, since ZB and ES are usually inversely correlated.
Similar to how it's done in this picture below (The VIX price goes up as you go down the chart):
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Anyone could help me out in setting it up?

Also, does anyone know how to set it so that each vertical line = 1 day, it's currently 7 days for each vertical line.


Last edited by JustinIsHere; November 21st, 2014 at 11:04 PM.
Reply With Quote
 
  #2 (permalink)
3rd times a charm!
San Francisco CA
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: CQG
Favorite Futures: ES
 
Zxeses's Avatar
 
Posts: 139 since Jun 2014
Thanks: 90 given, 171 received

Just off the top of my head...

Create a new indicator with 1 plot of an SMA(1) where each value is multiplied by -1.

Something like this:

double val = SMA(1)[0] * -1;
MyPlot1.Set(val);

If you keep the indicator left aligned like your data plot, set the data plot to Overlay and Transparent, you wouldnt need the extra code to create a Dataseries. Might be a good easy one for a new coder to cut your teeth on.

Reply With Quote
The following user says Thank You to Zxeses for this post:
 
  #3 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Beginner
Platform: NinjaTrader, Multicharts
Favorite Futures: ES
 
Posts: 96 since Dec 2011
Thanks: 46 given, 84 received


Ok, never fiddled with the Ninjatrader Indicator wizard, so this is my first dib at it. I'm getting an error in the code and I'm not quite sure what's going. LOL. I just pasted what you wrote, inside a document I created with the wizard, with most settings on default and kept hitting next (I was thinking I could edit out what's not needed).

I thought this whole idea could be easily done by tweaking some settings in Ninjatrader

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


 
Code
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion

// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
    /// <summary>
    /// Indicator used to invert an instrument's price in order to create a coupling/decoupling chart.
    /// </summary>
    [Description("Indicator used to invert an instrument's price in order to create a coupling/decoupling chart.")]
    public class CouplingDecoupling : Indicator
    {
        #region Variables
        // Wizard generated variables
            private int myInput0 = 1; // Default setting for MyInput0
        // User defined variables (add any user defined variables below)
        #endregion

        /// <summary>
        /// This method is used to configure the indicator and is called once before any bar data is loaded.
        /// </summary>
        protected override void Initialize()
		double val = SMA(1)[0] * -1;
		MyPlot1.Set(val);

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            // Use this method for calculating your indicator values. Assign a value to each
            // plot below by replacing 'Close[0]' with your own formula.
            Plot0.Set(Close[0]);
        }

        #region Properties
        [Browsable(false)]	// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
        [XmlIgnore()]		// this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
        public DataSeries Plot0
        {
            get { return Values[0]; }
        }

        [Description("")]
        [GridCategory("Parameters")]
        public int MyInput0
        {
            get { return myInput0; }
            set { myInput0 = Math.Max(1, value); }
        }
        #endregion
    }
}

Reply With Quote
 
  #4 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Beginner
Platform: NinjaTrader, Multicharts
Favorite Futures: ES
 
Posts: 96 since Dec 2011
Thanks: 46 given, 84 received

I took a look at this post (Plotting inverse of ZN price - NinjaTrader Support Forum) and I'm not sure how to apply it to build an indicator. Could anyone provide some inputs as how to format it?

Reply With Quote
 
  #5 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,215 since Jun 2009
Thanks: 628 given, 6,313 received
Forum Reputation: Legendary


JustinIsHere View Post
I took a look at this post (Plotting inverse of ZN price - NinjaTrader Support Forum) and I'm not sure how to apply it to build an indicator. Could anyone provide some inputs as how to format it?

try this https://futures.io/elite-circle/1261-want-your-ninjatrader-indicator-created-free-824.html#post343764

Reply With Quote
The following user says Thank You to cory for this post:
 
  #6 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Beginner
Platform: NinjaTrader, Multicharts
Favorite Futures: ES
 
Posts: 96 since Dec 2011
Thanks: 46 given, 84 received



Thanks cory, although I wasn't able to find how to plot another instrument on the same using "Line on close" Chart style.

However, I found this (Links and Downloads Manager - NinjaTrader Support Forum) to work.

Here's what it looks like:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Settings Used:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
 
  #7 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Beginner
Platform: NinjaTrader, Multicharts
Favorite Futures: ES
 
Posts: 96 since Dec 2011
Thanks: 46 given, 84 received

Now if there was a way to have a divergence indicator that could give me a number so that I could tell for sure that there is a divergence forming...
Like something that could calculate the distance between the two prices.

Reply With Quote

Reply



futures io > > > > Creating a Coupling/Decoupling Chart - Help Needed!

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a 20 period EMA of a 60 min chart in a 5 min chart. CapeDR NinjaTrader 7 May 23rd, 2014 04:37 AM
Creating a new HLC Chart Style (not an indicator) pawnbroker NinjaTrader Programming 3 January 18th, 2014 11:43 PM
Programmer needed for Renko Chart strategy ashtheace Sierra Chart Programming 10 July 4th, 2012 10:42 PM
creating custom 'forms' or chart windows dlatbm NinjaTrader Programming 3 October 20th, 2011 08:38 AM


All times are GMT -4. The time now is 04:01 AM.

Copyright © 2017 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
Page generated 2017-12-12 in 0.10 seconds with 19 queries on phoenix via your IP 54.82.112.193