elsidaliaj

Livelli SR Now Metatrader indicator conversion

CME_MINI:ES1!   標普500 E-mini期貨
hi guys this is a great indicator that paints basically pivot highs/lows but works much better than anything that's currently in TradingView. If someone can covert it over.


//+------------------------------------------------------------------+
//| Livelli_SR Now .mq4 |
//| L'angolo del Trader |
//| PaoloNieddu |
//+------------------------------------------------------------------+

#property copyright "L'angolo del Trader"
#property link "PaoloNieddu"
#property version "1.00"

//---- Buffer properties
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DeepSkyBlue
#property indicator_color2 Tomato
#property indicator_width1 1
#property indicator_width2 1

//---- Constants
#define ZZBack 1
#define ZZDev 5

//-------------------------------
// Input parameters
//-------------------------------
extern int ZigZagFast = 6;
extern int ZigZagSlow = 24;

//-------------------------------
// Buffers
//-------------------------------
double v1;
double v2;
double middle;

//-------------------------------
//Variabili interne
//-------------------------------

// Memorizza i valori dello ZigZag
double zz_slow_high = 0;
double zz_slow_low = 0;
double zz_fast_high = 0;
double zz_fast_low = 0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
// Buffers
IndicatorBuffers(2);
SetIndexArrow(0, 158); SetIndexStyle(0, DRAW_ARROW, STYLE_DOT); //158,159,108 sono i nuneri aschi per settare lo spessore dei pallini; piccolo,medio,grande
SetIndexBuffer(0, v1); // 167,110 per settare i quadrati piccolo e grande
SetIndexLabel(0,"Resistenza");
SetIndexArrow(1, 158); SetIndexStyle(1, DRAW_ARROW, STYLE_DOT);
SetIndexBuffer(1, v2);
SetIndexLabel(1,"Supporto");


IndicatorShortName("Livelli_SR Now");
Comment(""+"\n"+


"Copyright ©2015 L'Angolo Del Trading"+"\n"
"____________________________________" +"\n"
"Ultimo Massimo : "+ v1 +"\n"+
"......................................."+"\n"+
"Ultimo Minimo : "+v2+"\n"+
"___________________________________"+"\n"
);

//
return(0);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
// Start, limit, etc..
int start = 1;
int limit;
int counted_bars = IndicatorCounted();

//
if(counted_bars < 0)
return(-1);

// non controllare le barre che si ripetono
limit = Bars - 1 - counted_bars;

// Scorri dal passato al presente
for(int i = limit; i >= start; i--)
{
// ultimo Frattale
double val1 = upper_fractal(i);
double val2 = lower_fractal(i);

// Valori zigzag lenti
double zz_slow_high_t = iCustom(Symbol(), 0, "ZigZag", ZigZagSlow, ZZDev, ZZBack, 1, i);
if(zz_slow_high_t != 0) zz_slow_high = zz_slow_high_t;

// Zig Zag low
double zz_slow_low_t = iCustom(Symbol(), 0, "ZigZag", ZigZagSlow, ZZDev, ZZBack, 2, i);
if(zz_slow_low_t != 0) zz_slow_low = zz_slow_low_t;

//Valori zigzag Slow
double zz_fast_high_t = iCustom(Symbol(), 0, "ZigZag", ZigZagFast, ZZDev, ZZBack, 1, i);
if(zz_fast_high_t != 0) zz_fast_high = zz_fast_high_t;

// Zig Zag low
double zz_fast_low_t = iCustom(Symbol(), 0, "ZigZag", ZigZagFast, ZZDev, ZZBack, 2, i);
if(zz_fast_low_t != 0) zz
免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。