You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
i want to do some modification to the demarker indicator , so i implement it in this way ( i don't know his formula of it)
//+------------------------------------------------------------------+ //| demarker.mq4 | //| Copyright © 2004, MetaQuotes Software Corp. | //| http://www.metaquotes.net/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2004, MetaQuotes Software Corp." #property link "http://www.metaquotes.net/" #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 DodgerBlue //---- input parameters extern int MomPeriod=14; //---- buffers double MomBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,MomBuffer); //---- name for DataWindow and indicator subwindow label short_name="demarker("+MomPeriod+")"; IndicatorShortName(short_name); SetIndexLabel(0,short_name); //---- SetIndexDrawBegin(0,MomPeriod); //---- return(0); } //+------------------------------------------------------------------+ //| DEMARKE | //+------------------------------------------------------------------+ int start() { int i,counted_bars=IndicatorCounted(); //---- if(Bars<=MomPeriod) return(0); //---- initial zero if(counted_bars<1) for(i=1;i<=MomPeriod;i++) MomBuffer[Bars-i]=0.0; //---- i=Bars-MomPeriod-1; if(counted_bars>=MomPeriod) i=Bars-counted_bars-1; while(i>=0) { MomBuffer[i]=iDeMarker(NULL,0,14,i); i--; } return(0); } //+------------------------------------------------------------------+i use the iDeMarker func , i want to build it in the opimal way , any suggestions??