Supposedly this indicator if we have a 5 minute chart i chose to tell us the general trend of 15 min we would have to dial 1 or -1 depending on whether the 15-minute chart the trend is bullish or bearish.
I hope you can help me. Thank you very much in advance .
{
#region Variables
// Wizard generated variables
private double multiplicador = 2.500; // Default setting for Multiplicador
private int longuitud = 14; // Default setting for Longuitud
private int timeframe = 5; // Default setting for TimeFrame
// 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()
{
Add(PeriodType.Minute, timeframe);
Add(new Plot(Color.Green, PlotStyle.Line, "TradingLine"));
Overlay = false;
CalculateOnBarClose = true;
}
/// <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.
// Condition set 1
/*if (SuperTrend(longuitud, multiplicador, true).UpTrend.Get(0) == SuperTrend(longuitud, multiplicador, true).DownTrend.Get(0) )
{//Comprova que hi ha un tall
*/
if (BarsInProgress == 1){
if (Closes[1][0] > SuperTrend(BarsArray[1],longuitud, multiplicador, true).UpTrend[0])
{
TradingLine.Set(1);
}
if (Closes[1][0] < SuperTrend(BarsArray[1],longuitud, multiplicador, true).DownTrend[0])
{
TradingLine.Set(-1);
}
}
}
Comment