Anybody can convert this indicator from NT7 to SierraChart (MACDVOL) - Sierra Chart Programming | futures io social day trading
futures io futures trading


Anybody can convert this indicator from NT7 to SierraChart (MACDVOL)
Updated: Views / Replies:2,912 / 3
Created: by redpilot Attachments:1

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 dont 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
 

Anybody can convert this indicator from NT7 to SierraChart (MACDVOL)

  #1 (permalink)
Elite Member
S/Europe
 
Futures Experience: Advanced
Platform: NT, MT4
Broker/Data: Admiral Markets
Favorite Futures: Forex, CFDs
 
redpilot's Avatar
 
Posts: 41 since Apr 2010
Thanks: 89 given, 4 received

Anybody can convert this indicator from NT7 to SierraChart (MACDVOL)

//
// Copyright (C) 2006, NinjaTrader LLC <www.ninjatrader.com>.
// NinjaTrader reserves the right to modify or overwrite this NinjaScript component with each release.
//

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

// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
/// <summary>
/// The MACD (Moving Average Convergence/Divergence) is a trend following momentum indicator that shows the relationship between two moving averages of prices.
/// </summary>
[Description("The MACD (Moving Average Convergence/Divergence) is a trend following momentum indicator that shows the relationship between two moving averages of prices.")]
public class Zi7MacdVolColor02 : Indicator
{
#region Variables
private int fast = 12;
private int slow = 26;
private int smooth = 9;
private DataSeries fastEma;
private DataSeries slowEma;
#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(new Plot(new Pen (Color.Black, 3), "Macd"));
Add(new Plot(Color.DarkViolet, "Avg"));
Add(new Plot(new Pen(Color.Navy, 3), PlotStyle.Bar, "Diff"));

Add(new Line(Color.DarkGray, 0, "Zero line"));

fastEma = new DataSeries(this);
slowEma = new DataSeries(this);
}

/// <summary>
/// Calculates the indicator value(s) at the current index.
/// </summary>
protected override void OnBarUpdate()
{
if (CurrentBar == 0)
{
fastEma.Set(Input[0]);
slowEma.Set(Input[0]);
Value.Set(0);
Avg.Set(0);
Diff.Set(0);
}
else
{
fastEma.Set((2.0 / (1 + Fast)) * Volume[0] + (1 - (2.0 / (1 + Fast))) * fastEma[1]);
slowEma.Set((2.0 / (1 + Slow)) * Volume[0] + (1 - (2.0 / (1 + Slow))) * slowEma[1]);

double macd = fastEma[0] - slowEma[0];
double macdAvg = (2.0 / (1 + Smooth)) * macd + (1 - (2.0 / (1 + Smooth))) * Avg[1];

Value.Set(macd);
Avg.Set(macdAvg);
Diff.Set(macd);
{
if ( Diff[0] > 0 )
PlotColors[2][0] = Color.Green;
else
PlotColors[2][0] = Color.Red;
}
{
if ( Macd[0] > 0 )
PlotColors[2][0] = Color.Green;
else
PlotColors[2][0] = Color.Red;
}
}
}

#region Properties
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore()]
public DataSeries Avg
{
get { return Values[1]; }
}

/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore()]
public DataSeries Default
{
get { return Values[0]; }
}

/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore()]
public DataSeries Diff
{
get { return Values[2]; }
}
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore()]
public DataSeries Macd
{
get { return Values[2]; }
}

/// <summary>
/// </summary>
[Description("Number of bars for fast EMA")]
[GridCategory("Parameters")]
public int Fast
{
get { return fast; }
set { fast = Math.Max(1, value); }
}

/// <summary>
/// </summary>
[Description("Number of bars for slow EMA")]
[GridCategory("Parameters")]
public int Slow
{
get { return slow; }
set { slow = Math.Max(1, value); }
}

/// <summary>
/// </summary>
[Description("Number of bars for smoothing")]
[GridCategory("Parameters")]
public int Smooth
{
get { return smooth; }
set { smooth = Math.Max(1, value); }
}
#endregion
}
}

#region NinjaScript generated code. Neither change nor remove.
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
public partial class Indicator : IndicatorBase
{
private Zi7MacdVolColor02[] cacheZi7MacdVolColor02 = null;

private static Zi7MacdVolColor02 checkZi7MacdVolColor02 = new Zi7MacdVolColor02();

/// <summary>
/// The MACD (Moving Average Convergence/Divergence) is a trend following momentum indicator that shows the relationship between two moving averages of prices.
/// </summary>
/// <returns></returns>
public Zi7MacdVolColor02 Zi7MacdVolColor02(int fast, int slow, int smooth)
{
return Zi7MacdVolColor02(Input, fast, slow, smooth);
}

/// <summary>
/// The MACD (Moving Average Convergence/Divergence) is a trend following momentum indicator that shows the relationship between two moving averages of prices.
/// </summary>
/// <returns></returns>
public Zi7MacdVolColor02 Zi7MacdVolColor02(Data.IDataSeries input, int fast, int slow, int smooth)
{
if (cacheZi7MacdVolColor02 != null)
for (int idx = 0; idx < cacheZi7MacdVolColor02.Length; idx++)
if (cacheZi7MacdVolColor02[idx].Fast == fast && cacheZi7MacdVolColor02[idx].Slow == slow && cacheZi7MacdVolColor02[idx].Smooth == smooth && cacheZi7MacdVolColor02[idx].EqualsInput(input))
return cacheZi7MacdVolColor02[idx];

lock (checkZi7MacdVolColor02)
{
checkZi7MacdVolColor02.Fast = fast;
fast = checkZi7MacdVolColor02.Fast;
checkZi7MacdVolColor02.Slow = slow;
slow = checkZi7MacdVolColor02.Slow;
checkZi7MacdVolColor02.Smooth = smooth;
smooth = checkZi7MacdVolColor02.Smooth;

if (cacheZi7MacdVolColor02 != null)
for (int idx = 0; idx < cacheZi7MacdVolColor02.Length; idx++)
if (cacheZi7MacdVolColor02[idx].Fast == fast && cacheZi7MacdVolColor02[idx].Slow == slow && cacheZi7MacdVolColor02[idx].Smooth == smooth && cacheZi7MacdVolColor02[idx].EqualsInput(input))
return cacheZi7MacdVolColor02[idx];

Zi7MacdVolColor02 indicator = new Zi7MacdVolColor02();
indicator.BarsRequired = BarsRequired;
indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
indicator.Input = input;
indicator.Fast = fast;
indicator.Slow = slow;
indicator.Smooth = smooth;
Indicators.Add(indicator);
indicator.SetUp();

Zi7MacdVolColor02[] tmp = new Zi7MacdVolColor02[cacheZi7MacdVolColor02 == null ? 1 : cacheZi7MacdVolColor02.Length + 1];
if (cacheZi7MacdVolColor02 != null)
cacheZi7MacdVolColor02.CopyTo(tmp, 0);
tmp[tmp.Length - 1] = indicator;
cacheZi7MacdVolColor02 = tmp;
return indicator;
}
}
}
}

// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
public partial class Column : ColumnBase
{
/// <summary>
/// The MACD (Moving Average Convergence/Divergence) is a trend following momentum indicator that shows the relationship between two moving averages of prices.
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.Zi7MacdVolColor02 Zi7MacdVolColor02(int fast, int slow, int smooth)
{
return _indicator.Zi7MacdVolColor02(Input, fast, slow, smooth);
}

/// <summary>
/// The MACD (Moving Average Convergence/Divergence) is a trend following momentum indicator that shows the relationship between two moving averages of prices.
/// </summary>
/// <returns></returns>
public Indicator.Zi7MacdVolColor02 Zi7MacdVolColor02(Data.IDataSeries input, int fast, int slow, int smooth)
{
return _indicator.Zi7MacdVolColor02(input, fast, slow, smooth);
}
}
}

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
public partial class Strategy : StrategyBase
{
/// <summary>
/// The MACD (Moving Average Convergence/Divergence) is a trend following momentum indicator that shows the relationship between two moving averages of prices.
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.Zi7MacdVolColor02 Zi7MacdVolColor02(int fast, int slow, int smooth)
{
return _indicator.Zi7MacdVolColor02(Input, fast, slow, smooth);
}

/// <summary>
/// The MACD (Moving Average Convergence/Divergence) is a trend following momentum indicator that shows the relationship between two moving averages of prices.
/// </summary>
/// <returns></returns>
public Indicator.Zi7MacdVolColor02 Zi7MacdVolColor02(Data.IDataSeries input, int fast, int slow, int smooth)
{
if (InInitialize && input == null)
throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

return _indicator.Zi7MacdVolColor02(input, fast, slow, smooth);
}
}
}
#endregion

Attached Thumbnails
Anybody can convert this indicator from NT7 to SierraChart (MACDVOL)-macdvol.jpg  
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.

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


SC let you specify a study bases on other study np. add a vol study then add a macd go to setting change it to base on vol study.

Reply With Quote
 
  #4 (permalink)
Elite Member
S/Europe
 
Futures Experience: Advanced
Platform: NT, MT4
Broker/Data: Admiral Markets
Favorite Futures: Forex, CFDs
 
redpilot's Avatar
 
Posts: 41 since Apr 2010
Thanks: 89 given, 4 received

Ok. I did it!!!!
Thank you cory!!!


Last edited by redpilot; February 25th, 2011 at 10:51 PM.
Reply With Quote

Reply



futures io > > > > > Anybody can convert this indicator from NT7 to SierraChart (MACDVOL)

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
Convert PriceSwing Indicator to Strategy marcelo_s NinjaTrader Programming 28 September 12th, 2013 07:10 PM
And what about SierraChart lolu Sierra Chart 466 July 24th, 2011 09:45 AM
Conversion of a NinjaTrader Strategy to SierraChart hanssmith Sierra Chart Programming 2 November 20th, 2010 01:14 AM
Convert MT4- Indicator-Help : Easy Trend Visualizer Rickb The Elite Circle 4 May 31st, 2010 08:18 AM


All times are GMT -4. The time now is 02:40 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.14 seconds with 20 queries on phoenix via your IP 54.82.56.95