how to draw over last bar .... New comment ndrbsgn 2015.11.23 10:49 hello ,help me whith this code_ ----------------------------------------------------------------------------- #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 White extern int year=2010; extern int month=6; extern int day=1; extern int hour=0; extern int minute=0; extern double inf=18000; extern double sup=21000; extern double cyclelength=60; extern double trend=0; extern int Ncicli=2; //---- buffers double Hurst[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators IndicatorBuffers(1); SetIndexBuffer(0,Hurst); SetIndexStyle(0,DRAW_LINE,0,1); IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)); IndicatorShortName(WindowExpertName()); return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { double a,w1,w2,w3,w4,cycle,x,grc,c,b,pi; int i,limit,phase; int flag; int counted_bars = IndicatorCounted(); if(counted_bars =0; i--) { if (day==TimeDay(Time[i]) && month==TimeMonth(Time[i]) && year==TimeYear(Time[i]) && hour==TimeHour(Time[i]) && minute==TimeMinute(Time[i])){ flag=1; } if( flag==0) { Hurst[i]=EMPTY_VALUE; } else { a=a+1; x=(360/cyclelength)*a; phase=-90; pi=3.1415926535; w1=MathSin(((8*x+phase)*pi)/180); w2=2*MathSin(((4*x+phase)*pi)/180); w3=3*MathSin(((2*x+phase)*pi)/180); w4=4*MathSin(((x+phase)*pi)/180); if (Ncicli==3) { w1=MathSin(((12*x+phase)*pi)/180); w2=2*MathSin(((6*x+phase)*pi)/180); w3=3*MathSin(((3*x+phase)*pi)/180); w4=4*MathSin(((x+phase)*pi)/180); } cycle=(w1+w2+w3+w4); grc=0.01029; c=(grc*trend*1); b=b+c; Hurst[i]=(cycle+b+10)*((sup-inf)/15)+inf; } } return(0); } //+-----------------------------+ i would continue to plot this curves over last bar to end window thanks andrea Files: battleplan.mq4 3 kb Coding help Help with a simple iCustom 2 Buffer icustom () Keith Watford 2015.11.23 10:53 #1 Please use the SRC button when posting code and write code that is easily readable New comment
hello ,help me whith this code_ -----------------------------------------------------------------------------
#property indicator_chart_window #property indicator_buffers 1
#property indicator_color1 White
extern int year=2010;
extern int month=6;
extern int day=1;
extern int hour=0;
extern int minute=0;
extern double inf=18000;
extern double sup=21000;
extern double cyclelength=60;
extern double trend=0;
extern int Ncicli=2;
//---- buffers double Hurst[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function | //+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(1);
SetIndexBuffer(0,Hurst);
SetIndexStyle(0,DRAW_LINE,0,1);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
IndicatorShortName(WindowExpertName());
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { double a,w1,w2,w3,w4,cycle,x,grc,c,b,pi; int i,limit,phase; int flag; int counted_bars = IndicatorCounted(); if(counted_bars =0; i--) { if (day==TimeDay(Time[i]) && month==TimeMonth(Time[i]) && year==TimeYear(Time[i]) && hour==TimeHour(Time[i]) && minute==TimeMinute(Time[i])){ flag=1; } if( flag==0) { Hurst[i]=EMPTY_VALUE; } else { a=a+1; x=(360/cyclelength)*a; phase=-90; pi=3.1415926535; w1=MathSin(((8*x+phase)*pi)/180); w2=2*MathSin(((4*x+phase)*pi)/180); w3=3*MathSin(((2*x+phase)*pi)/180); w4=4*MathSin(((x+phase)*pi)/180); if (Ncicli==3) { w1=MathSin(((12*x+phase)*pi)/180); w2=2*MathSin(((6*x+phase)*pi)/180); w3=3*MathSin(((3*x+phase)*pi)/180); w4=4*MathSin(((x+phase)*pi)/180); } cycle=(w1+w2+w3+w4); grc=0.01029; c=(grc*trend*1); b=b+c; Hurst[i]=(cycle+b+10)*((sup-inf)/15)+inf; } } return(0); } //+-----------------------------+
i would continue to plot this curves over last bar to end window thanks andrea