Publi |
Publi |
//Al final he podido programarlo yo:
Código:#property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_color2 Red double BufPositivo[], BufNegativo[]; int init() { SetIndexBuffer(0, BufPositivo); SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 2); SetIndexBuffer(1, BufNegativo); SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 2); return; } int start() { //% de cambio = ((precio de cierre - precio de apertura) / precio de apertura) * 100 double var; int CountedBars = IndicatorCounted(); int i = Bars - CountedBars - 1; while(i >= 0) { var = ((Close[i] - Open[i]) / Open[i]) * 100; if (var > 0) { BufPositivo[i] = var; BufNegativo[i] = 0; } else { BufPositivo[i] = 0; BufNegativo[i] = var; } i--; } return; }Foro de Forex Trading United
Aviso Legal Ley Orgánica 15/1999, de 13 de diciembre, de Protección de Datos de Carácter Personal |