Plotting change. Easy? - NinjaTrader Programming | futures io social day trading
futures io futures trading


Plotting change. Easy?
Updated: Views / Replies:427 / 1
Created: by traderjh 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
 

Plotting change. Easy?

  #1 (permalink)
Elite Member
South Jordan UT
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: Forex
 
Posts: 15 since Jan 2013
Thanks: 6 given, 1 received

Plotting change. Easy?

Hello all,

I got PMA indicator from public domain and I like to try using this for strategy. I am trying to modify PMA indicator into a strategy. But it doesn't work for me. I know I have a lot to learn. It is a simple program and I am not familiar with the differences between indicator and strategy plottings.

Would it be possible if you could just modify those lines below? I hope it is not too big of a task and is really simple. Is it doable?

Let me know.

Many thanks,
-traderjh


 
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>
    /// Predictive Moving Average (ehlers)
    /// </summary>
    [Description("Predictive Moving Average (ehlers)")]
    public class PMA : Indicator
    {
        #region Variables
    // declare the variables here
        double WMA2;
        double Trigger;
		
    // create the dataseries here
	private DataSeries WMA1;
	private DataSeries Predict;
        #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()
        {
            // add the plots here
            Add(new Plot(new Pen(Color.Blue, 3), PlotStyle.Line, "Predict_Plot"));
            Add(new Plot(new Pen(Color.Red, 3), PlotStyle.Line, "Trigger_Plot"));
            CalculateOnBarClose    = true;
            Overlay                = false;
            PriceTypeSupported    = true;
			
	// initialize dataseries here
	   WMA1 = new DataSeries(this);
	   Predict = new DataSeries(this);
        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
	// if there isn't enough data just set the variables to 0
            if (CurrentBar < 7) 
            {
                WMA1.Set(0);
                WMA2 = 0;
                Predict.Set(0);
                Trigger = 0;
            }
	// else set the variables to the real values
            else
            {
		WMA1.Set((7*Median[0] + 6*Median[1] + 5*Median[2] + 4*Median[3] + 3*Median[4] + 2*Median[5] + Median[6])/28);
		WMA2 = (7*WMA1[0] + 6*WMA1[1] + 5*WMA1[2] + 4*WMA1[3] + 3*WMA1[4] + 2*WMA1[5] + WMA1[6])/28;
		Predict.Set(2*WMA1[0] - WMA2);
		Trigger = (4*Predict[0] + 3*Predict[1] + 2*Predict[2] + Predict[3])/10;
	}
			
	    // set the plots
		Predict_Plot.Set(Predict[0]);
		Trigger_Plot.Set(Trigger); 
        }

        #region Properties;
		// create the dataseries for the plots
        [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 Predict_Plot
        {
        get { return Values[0]; }
        }
        [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 Trigger_Plot
        {
        get { return Values[1]; }
        }
        #endregion

    }
}

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Reply



futures io > > > > > Plotting change. Easy?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is Apple Plotting Against Your Old iPhone? Quick Summary News and Current Events 0 November 1st, 2013 05:30 PM
Is there an indicator that shows price change averaged with volume change intrabar? Itchymoku NinjaTrader 8 July 31st, 2012 08:40 PM
Plotting options Bespoke Options on Futures 8 December 11th, 2011 06:59 PM
easy language ..not easy... Serger EasyLanguage Programming 4 April 26th, 2011 04:42 PM
LA Times: "Foreign currency trading is easy — an easy way to lose money" shodson News and Current Events 7 April 4th, 2011 10:20 AM


All times are GMT -4. The time now is 06:12 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-17 in 0.08 seconds with 19 queries on phoenix via your IP 54.82.81.154