Nous souhaitons attirer l'attention des contributeurs de nos forums que la législation française requiert que vous indiquiez si vous avez une position ouverte dans un instrument sur lequel vous émettez une opinion. Veuillez respecter cette recommandation faite par l’AMF (Autorité des Marchés Financiers) . Pour plus d'information : lire ce PDF.
#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>
/// Indicateur STPMT d'E.Lefort
/// </summary>
[Description("Indicateur STPMT d'E.Lefort")]
public class STPMT : Indicator
{
#region Variables
// Wizard generated variables
private int periodM = 9; // Default setting for PeriodM (Periode de la Moyenne mobile simple de la STPMT)
// User defined variables (add any user defined variables below)
private DataSeries K1;
private DataSeries K2;
private DataSeries K3;
private DataSeries K4;
private DataSeries nom1;
private DataSeries nom2;
private DataSeries nom3;
private DataSeries nom4;
private DataSeries den1;
private DataSeries den2;
private DataSeries den3;
private DataSeries den4;
#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.Blue, 2), "Stpmt"));
Add(new Plot(new Pen(Color.Red, 2), "MM9_Stpmt"));
Add(new Plot(Color.Green, PlotStyle.Line, "Stoch1"));
Add(new Plot(Color.Orange, PlotStyle.Line, "Stoch2"));
Add(new Plot(Color.Magenta, PlotStyle.Line, "Stoch3"));
Add(new Plot(Color.DarkViolet, PlotStyle.Line, "Stoch4"));
Add(new Line(Color.FromKnownColor(KnownColor.Gray), 50, "Ligne50"));
Add(new Line(Color.FromKnownColor(KnownColor.Gray), 80, "Ligne80"));
Add(new Line(Color.FromKnownColor(KnownColor.Gray), 20, "Ligne20"));
K1 = new DataSeries(this);
K2 = new DataSeries(this);
K3 = new DataSeries(this);
K4 = new DataSeries(this);
den1 = new DataSeries(this);
den2 = new DataSeries(this);
den3 = new DataSeries(this);
den4 = new DataSeries(this);
nom1 = new DataSeries(this);
nom2 = new DataSeries(this);
nom3 = new DataSeries(this);
nom4 = new DataSeries(this);
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Calcule le Stochastique (5,3)
nom1.Set(Close[0] - MIN(Low, 5)[0]);
den1.Set(MAX(High, 5)[0] - MIN(Low, 5)[0]);
K1.Set(100 * nom1[0] / (den1[0] == 0 ? 1.0 : den1[0]));
Stoch1.Set(SMA(K1, 3)[0]);
// Calcule la moyenne mobile simple 9 périodes du STPMT
MM9_Stpmt.Set(SMA(Stpmt,periodM)[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 Stpmt
{
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 MM9_Stpmt
{
get { return Values[1]; }
}
[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 Stoch1
{
get { return Values[2]; }
}
[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 Stoch2
{
get { return Values[3]; }
}
[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 Stoch3
{
get { return Values[4]; }
}
[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 Stoch4
{
get { return Values[5]; }
}
[Description("Periode de la moyenne mobile de la STPMT")]
[Category("Parameters")]
public int PeriodM
{
get { return periodM; }
set { periodM = 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 STPMT[] cacheSTPMT = null;
// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
public partial class Column : ColumnBase
{
/// <summary>
/// Indicateur STPMT d'E.Lefort
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.STPMT STPMT(int periodM)
{
return _indicator.STPMT(Input, periodM);
}
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
public partial class Strategy : StrategyBase
{
/// <summary>
/// Indicateur STPMT d'E.Lefort
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.STPMT STPMT(int periodM)
{
return _indicator.STPMT(Input, periodM);
}
/// <summary>
/// Indicateur STPMT d'E.Lefort
/// </summary>
/// <returns></returns>
public Indicator.STPMT STPMT(Data.IDataSeries input, int periodM)
{
if (InInitialize && input == null)
throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");
#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>
/// Enter the description of your new custom indicator here
/// </summary>
[Description("Indicateur Repulse d'E.Lefort")]
public class Repulse : Indicator
{
#region Variables
// Wizard generated variables
private int period1 = 1; // Default setting for Period1
private int period2 = 5; // Default setting for Period2
private int period3 = 15; // Default setting for Period3
// User defined variables (add any user defined variables below)
private DataSeries bullishthrust1;
private DataSeries bullishthrust2;
private DataSeries bullishthrust3;
private DataSeries bearishthrust1;
private DataSeries bearishthrust2;
private DataSeries bearishthrust3;
#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(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "Repulse1"));
Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Line, "Repulse2"));
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Repulse3"));
Add(new Line(Color.FromKnownColor(KnownColor.Black), 0, "Zeroline"));
CalculateOnBarClose = false;
Overlay = false;
PriceTypeSupported = false;
bullishthrust1 = new DataSeries(this);
bullishthrust2 = new DataSeries(this);
bullishthrust3 = new DataSeries(this);
bearishthrust1 = new DataSeries(this);
bearishthrust2 = new DataSeries(this);
bearishthrust3 = new DataSeries(this);
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{ if (CurrentBar<15)
return;
else
{
int p1=5*period1;
int p2=5*period2;
int p3=5*period3;
double myHigh1=MAX(High,period1)[0];
double myHigh2=MAX(High,period2)[0];
double myHigh3=MAX(High,period3)[0];
double myLow1=MIN(Low,period1)[0];
double myLow2=MIN(Low,period2)[0];
double myLow3=MIN(Low,period3)[0];
bullishthrust1.Set((3*Close[0]-2*myLow1-Open[period1])/Close[0]*100);
bullishthrust2.Set((3*Close[0]-2*myLow2-Open[period2])/Close[0]*100);
bullishthrust3.Set((3*Close[0]-2*myLow3-Open[period3])/Close[0]*100);
bearishthrust1.Set((Open[period1]+2*myHigh1-3*Close[0])/Close[0]*100);
bearishthrust2.Set((Open[period2]+2*myHigh2-3*Close[0])/Close[0]*100);
bearishthrust3.Set((Open[period3]+2*myHigh3-3*Close[0])/Close[0]*100);
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Repulse1.Set(mm1-mb1);
Repulse2.Set(mm2-mb2);
Repulse3.Set(mm3-mb3);
}
}
#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 Repulse1
{
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 Repulse2
{
get { return Values[1]; }
}
[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 Repulse3
{
get { return Values[2]; }
}
[Description("")]
[Category("Parameters")]
public int Period1
{
get { return period1; }
set { period1 = Math.Max(1, value); }
}
[Description("")]
[Category("Parameters")]
public int Period2
{
get { return period2; }
set { period2 = Math.Max(1, value); }
}
[Description("")]
[Category("Parameters")]
public int Period3
{
get { return period3; }
set { period3 = 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 Repulse[] cacheRepulse = null;
private static Repulse checkRepulse = new Repulse();
/// <summary>
/// Indicateur Repulse d'E.Lefort
/// </summary>
/// <returns></returns>
public Repulse Repulse(int period1, int period2, int period3)
{
return Repulse(Input, period1, period2, period3);
}
/// <summary>
/// Indicateur Repulse d'E.Lefort
/// </summary>
/// <returns></returns>
public Repulse Repulse(Data.IDataSeries input, int period1, int period2, int period3)
{
checkRepulse.Period1 = period1;
period1 = checkRepulse.Period1;
checkRepulse.Period2 = period2;
period2 = checkRepulse.Period2;
checkRepulse.Period3 = period3;
period3 = checkRepulse.Period3;
if (cacheRepulse != null)
for (int idx = 0; idx < cacheRepulse.Length; idx++)
if (cacheRepulse[idx].Period1 == period1 && cacheRepulse[idx].Period2 == period2 && cacheRepulse[idx].Period3 == period3 && cacheRepulse[idx].EqualsInput(input))
return cacheRepulse[idx];
// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
public partial class Column : ColumnBase
{
/// <summary>
/// Indicateur Repulse d'E.Lefort
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.Repulse Repulse(int period1, int period2, int period3)
{
return _indicator.Repulse(Input, period1, period2, period3);
}
/// <summary>
/// Indicateur Repulse d'E.Lefort
/// </summary>
/// <returns></returns>
public Indicator.Repulse Repulse(Data.IDataSeries input, int period1, int period2, int period3)
{
return _indicator.Repulse(input, period1, period2, period3);
}
}
}
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
public partial class Strategy : StrategyBase
{
/// <summary>
/// Indicateur Repulse d'E.Lefort
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.Repulse Repulse(int period1, int period2, int period3)
{
return _indicator.Repulse(Input, period1, period2, period3);
}
/// <summary>
/// Indicateur Repulse d'E.Lefort
/// </summary>
/// <returns></returns>
public Indicator.Repulse Repulse(Data.IDataSeries input, int period1, int period2, int period3)
{
if (InInitialize && input == null)
throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");
Ci-après, vous trouverez le code pour la MACD JL (marche pour NT6.5 et NT7)
<center><img src='http://images.pro-at.com/forums-bourse/0110/25828_071011.jpg' alt='' /></center>
<font color='#056001'>//
// 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 MACDJL (Moving Average Convergence/Divergence) is a trend following momentum indicator that shows the relationship between two moving averages of prices.
/// </summary>
[Description("MACD + MACD ZeroLag parametrées à la Johnlee.")]
public class MACDJL : Indicator
{
#region Variables
private int fast = 9;
private int slow = 19;
private int smooth = 6;
private double coeffBoll= 1.4;
private DataSeries fastEma;
private DataSeries slowEma;
private DataSeries fastEmaZL;
private DataSeries slowEmaZL;
private DataSeries smoothEmaZL;
private DataSeries ddsmoothEmaZL;
// Pour les bollinger Min
DataSeries minUp;
DataSeries minDown;
// Pour les zones à dessiner
private int beginUp=-1;
private int beginDown=-1;
private int beginUpZL=-1;
private int beginDownZL=-1;
private int[] suite;
private int isOut=0;
private const int MAXOUT=40;
#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(Color.MidnightBlue,PlotStyle.Dot, "MACD"));
Add(new Plot(Color.DarkViolet, "Avg"));
#region Properties
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore()]
public DataSeries MACD
{
get { return Values[0]; }
}
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore()]
public DataSeries Avg
{
get { return Values[1]; }
}
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore()]
public DataSeries MACDZL
{
get { return Values[2]; }
}
public DataSeries AvgZL
{
get { return Values[3]; }
}
/// <summary>
/// </summary>
[Description("Number of bars for fast EMA")]
[Category("Parameters")]
public int Fast
{
get { return fast; }
set { fast = Math.Max(1, value); }
}
/// <summary>
/// </summary>
[Description("Number of bars for slow EMA")]
[Category("Parameters")]
public int Slow
{
get { return slow; }
set { slow = Math.Max(1, value); }
}
/// <summary>
/// </summary>
[Description("Number of bars for smoothing")]
[Category("Parameters")]
public int Smooth
{
get { return smooth; }
set { smooth = Math.Max(1, value); }
}
[Description("MACD Bollinger coefficient")]
[Category("Parameters")]
public double CoeffBoll
{
get { return coeffBoll; }
set { coeffBoll = Math.Max(0.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 MACDJL[] cacheMACDJL = null;
private static MACDJL checkMACDJL = new MACDJL();
/// <summary>
/// MACD + MACD ZeroLag parametrées à la Johnlee.
/// </summary>
/// <returns></returns>
public MACDJL MACDJL(double coeffBoll, int fast, int slow, int smooth)
{
return MACDJL(Input, coeffBoll, fast, slow, smooth);
}
/// <summary>
/// MACD + MACD ZeroLag parametrées à la Johnlee.
/// </summary>
/// <returns></returns>
public MACDJL MACDJL(Data.IDataSeries input, double coeffBoll, int fast, int slow, int smooth)
{
checkMACDJL.CoeffBoll = coeffBoll;
coeffBoll = checkMACDJL.CoeffBoll;
checkMACDJL.Fast = fast;
fast = checkMACDJL.Fast;
checkMACDJL.Slow = slow;
slow = checkMACDJL.Slow;
checkMACDJL.Smooth = smooth;
smooth = checkMACDJL.Smooth;
if (cacheMACDJL != null)
for (int idx = 0; idx < cacheMACDJL.Length; idx++)
if (Math.Abs(cacheMACDJL[idx].CoeffBoll - coeffBoll) <= double.Epsilon && cacheMACDJL[idx].Fast == fast && cacheMACDJL[idx].Slow == slow && cacheMACDJL[idx].Smooth == smooth && cacheMACDJL[idx].EqualsInput(input))
return cacheMACDJL[idx];
// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
public partial class Column : ColumnBase
{
/// <summary>
/// MACD + MACD ZeroLag parametrées à la Johnlee.
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.MACDJL MACDJL(double coeffBoll, int fast, int slow, int smooth)
{
return _indicator.MACDJL(Input, coeffBoll, fast, slow, smooth);
}
/// <summary>
/// MACD + MACD ZeroLag parametrées à la Johnlee.
/// </summary>
/// <returns></returns>
public Indicator.MACDJL MACDJL(Data.IDataSeries input, double coeffBoll, int fast, int slow, int smooth)
{
return _indicator.MACDJL(input, coeffBoll, fast, slow, smooth);
}
}
}
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
public partial class Strategy : StrategyBase
{
/// <summary>
/// MACD + MACD ZeroLag parametrées à la Johnlee.
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.MACDJL MACDJL(double coeffBoll, int fast, int slow, int smooth)
{
return _indicator.MACDJL(Input, coeffBoll, fast, slow, smooth);
}
/// <summary>
/// MACD + MACD ZeroLag parametrées à la Johnlee.
/// </summary>
/// <returns></returns>
public Indicator.MACDJL MACDJL(Data.IDataSeries input, double coeffBoll, 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");
<font color='#056001'>#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>
/// Donne les Squeez MACD
/// </summary>
[Description("Donne les Squeez MACD")]
public class SqueezMACD : Indicator
{
#region Variables
// Wizard generated variables
private int fast = 9;
private int slow = 19;
private int smooth = 6;
private double coeffBoll = 1.400; // Default setting for CoeffBoll
private int periodMAX = 70; // Default setting for PeriodMAX
private double pcSqueez = 0.300; // Default setting for pcSqueez
// User defined variables (add any user defined variables below)
private DataSeries fastEma;
private DataSeries slowEma;
private DataSeries MACD;
private DataSeries stdDevMACD;
private DataSeries SqueezUp;
private DataSeries SqueezDown;
private int beginSq=0;
private int beginAcc=0;
#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(Color.FromKnownColor(KnownColor.Green), PlotStyle.Bar, "AccelerationUp"));
Plots[0].Pen.Width =3;
Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Bar, "AccelerationDown"));
Plots[1].Pen.Width =3;
Add(new Plot(Color.FromKnownColor(KnownColor.DarkViolet), PlotStyle.Bar, "SortieUp"));
Add(new Plot(Color.FromKnownColor(KnownColor.Firebrick), PlotStyle.Bar, "SortieDown"));
Add(new Plot(Color.FromKnownColor(KnownColor.LightGray), PlotStyle.Line, "DelimUp"));
Add(new Plot(Color.FromKnownColor(KnownColor.LightGray), PlotStyle.Line, "DelimDown"));
Add(new Plot(Color.FromKnownColor(KnownColor.Black), PlotStyle.Line, "Phase"));
Add(new Line(Color.DarkGray, 0, "Zero line"));
fastEma = new DataSeries(this);
slowEma = new DataSeries(this);
MACD = new DataSeries(this);
stdDevMACD = new DataSeries(this);
SqueezUp = new DataSeries(this);
SqueezDown = new DataSeries(this);
/// <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.
DelimUp.Set(4);
DelimDown.Set(-4);
if (CurrentBar == 0) {
fastEma.Set(Input[0]);
slowEma.Set(Input[0]);
MACD.Set(0);
stdDevMACD.Set(1);
AccelerationUp.Set(0);
AccelerationDown.Set(0);
SqueezUp.Set(0);
SqueezDown.Set(0);
Phase.Set(0);
return;
}
#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 AccelerationUp
{
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 AccelerationDown
{
get { return Values[1]; }
}
[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 SortieUp
{
get { return Values[2]; }
}
[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 SortieDown
{
get { return Values[3]; }
}
[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 DelimUp
{
get { return Values[4]; }
}
[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 DelimDown
{
get { return Values[5]; }
}
[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 Phase
{
get { return Values[6]; }
}
[Description("Number of bars for fast EMA")]
[Category("Parameters")]
public int Fast
{
get { return fast; }
set { fast = Math.Max(1, value); }
}
/// <summary>
/// </summary>
[Description("Number of bars for slow EMA")]
[Category("Parameters")]
public int Slow
{
get { return slow; }
set { slow = Math.Max(1, value); }
}
/// <summary>
/// </summary>
[Description("Number of bars for smoothing")]
[Category("Parameters")]
public int Smooth
{
get { return smooth; }
set { smooth = Math.Max(1, value); }
}
[Description("Coefficient des Bollingers")]
[Category("Parameters")]
public double CoeffBoll
{
get { return coeffBoll; }
set { coeffBoll = Math.Max(0.100, value); }
}
[Description("Nombre de période maximum")]
[Category("Parameters")]
public int PeriodMAX
{
get { return periodMAX; }
set { periodMAX = Math.Max(1, value); }
}
[Description("Pourcentage détection squeez")]
[Category("Parameters")]
public double PcSqueez
{
get { return pcSqueez; }
set { pcSqueez = Math.Max(0.00, 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 SqueezMACD[] cacheSqueezMACD = null;
private static SqueezMACD checkSqueezMACD = new SqueezMACD();
/// <summary>
/// Donne les Squeez MACD
/// </summary>
/// <returns></returns>
public SqueezMACD SqueezMACD(double coeffBoll, int fast, double pcSqueez, int periodMAX, int slow, int smooth)
{
return SqueezMACD(Input, coeffBoll, fast, pcSqueez, periodMAX, slow, smooth);
}
/// <summary>
/// Donne les Squeez MACD
/// </summary>
/// <returns></returns>
public SqueezMACD SqueezMACD(Data.IDataSeries input, double coeffBoll, int fast, double pcSqueez, int periodMAX, int slow, int smooth)
{
checkSqueezMACD.CoeffBoll = coeffBoll;
coeffBoll = checkSqueezMACD.CoeffBoll;
checkSqueezMACD.Fast = fast;
fast = checkSqueezMACD.Fast;
checkSqueezMACD.PcSqueez = pcSqueez;
pcSqueez = checkSqueezMACD.PcSqueez;
checkSqueezMACD.PeriodMAX = periodMAX;
periodMAX = checkSqueezMACD.PeriodMAX;
checkSqueezMACD.Slow = slow;
slow = checkSqueezMACD.Slow;
checkSqueezMACD.Smooth = smooth;
smooth = checkSqueezMACD.Smooth;
// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
public partial class Column : ColumnBase
{
/// <summary>
/// Donne les Squeez MACD
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.SqueezMACD SqueezMACD(double coeffBoll, int fast, double pcSqueez, int periodMAX, int slow, int smooth)
{
return _indicator.SqueezMACD(Input, coeffBoll, fast, pcSqueez, periodMAX, slow, smooth);
}
/// <summary>
/// Donne les Squeez MACD
/// </summary>
/// <returns></returns>
public Indicator.SqueezMACD SqueezMACD(Data.IDataSeries input, double coeffBoll, int fast, double pcSqueez, int periodMAX, int slow, int smooth)
{
return _indicator.SqueezMACD(input, coeffBoll, fast, pcSqueez, periodMAX, slow, smooth);
}
}
}
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
public partial class Strategy : StrategyBase
{
/// <summary>
/// Donne les Squeez MACD
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.SqueezMACD SqueezMACD(double coeffBoll, int fast, double pcSqueez, int periodMAX, int slow, int smooth)
{
return _indicator.SqueezMACD(Input, coeffBoll, fast, pcSqueez, periodMAX, slow, smooth);
}
/// <summary>
/// Donne les Squeez MACD
/// </summary>
/// <returns></returns>
public Indicator.SqueezMACD SqueezMACD(Data.IDataSeries input, double coeffBoll, int fast, double pcSqueez, int periodMAX, 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");
Dans la pagaille du forum NinjaTrader je post ici.....
Besoin d'aide pour importation de code .
Pas mal de codes donnés ci-dessus mais comment les importer.
Pas aussi simple que PRT,le copier coller ne fonctionne pas .....
A partir de la fenêtre n°2 je ne remplie rien et je clique sur finish.
Apparait une fenêtre ou je vire tout et y colle le code STPMT , je compile et rien !!!!!
Rien trouvé sur le NET sur ce problème précis ....
Accepte ce qui est, laisse aller ce qui était et aie confiance en ce qui sera. (Bouddha)
Merci à vous deux .
Vous avez toujours réponse à tous .
J'ai fait un beau tuto ça pourra tour servir .
Pour info le code je l'ai chourrer à Chipeur mais je ne retrouve plus mon lien.......
Merci les garçons je vais étudier ça ce Week-end au frais .....
Accepte ce qui est, laisse aller ce qui était et aie confiance en ce qui sera. (Bouddha)
Merci à vous deux .
Vous avez toujours réponse à tous .
J'ai fait un beau tuto ça pourra tour servir .
Pour info le code je l'ai chourrer à Chipeur mais je ne retrouve plus mon lien.......
Merci les garçons je vais étudier ça ce Week-end au frais .....
Commentaire