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
hi
i've got this code iv worked to make better indicator coding skills and what im hoping to do is to replace the candlesticks.
suggestions?
//+------------------------------------------------------------------+ //| Indicator Name: ChartBucket //| E-mail: subgenius@inbox.com //+------------------------------------------------------------------+ #property copyright "Copyright 2016, Brian Lillard" #property link "http://5026.net78.net/" #property version "1.00" #property strict #property indicator_chart_window #property indicator_buffers 4 //+------------------------------------------------------------------+ color HL_Bull = Lime; int HL_Bull_Width = 1; color OC_Bull = Lime; int OC_Bull_Width = 6; //-- color HL_Bear = Red; int HL_Bear_Width = 1; color OC_Bear = Red; int OC_Bear_Width = 6; //-- //+------------------------------------------------------------------+ double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; //- int ExtCountedBars=0; //+------------------------------------------------------------------+ int init() { SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(0,DRAW_HISTOGRAM,0,HL_Bear_Width,HL_Bear); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle(1,DRAW_HISTOGRAM,0,HL_Bull_Width,HL_Bull); SetIndexBuffer(2,ExtMapBuffer3); SetIndexStyle(2,DRAW_HISTOGRAM,0,OC_Bear_Width,OC_Bear); SetIndexBuffer(3,ExtMapBuffer4); SetIndexStyle(3,DRAW_HISTOGRAM,0,OC_Bull_Width,OC_Bull); return(0); } //+------------------------------------------------------------------+ int start() { ExtCountedBars=IndicatorCounted(); if(ExtCountedBars<0){return(-1);} if(ExtCountedBars>0){ExtCountedBars--;} int pos=Bars-ExtCountedBars-1; while(pos>=0) { //set tops & bottoms if(Open[pos]<Close[pos]) { ExtMapBuffer1[pos]=Low[pos]; ExtMapBuffer2[pos]=High[pos]; } else { ExtMapBuffer1[pos]=High[pos]; ExtMapBuffer2[pos]=Low[pos]; } //set body ExtMapBuffer3[pos]=Open[pos]; ExtMapBuffer4[pos]=Close[pos]; //- pos--; } return(0); }