Нет, закрытие нужно такое: Закрытие всех ордеров на покупку происходит, когда голубая линия подвального индикатора с мелкими настройками пересечёт определённый уровень(настройки).Например нулевой уровень
Нет, закрытие нужно такое: Закрытие всех ордеров на покупку происходит, когда голубая линия подвального индикатора с мелкими настройками пересечёт определённый уровень(настройки).
// Offset in chart
int nShift;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
// Arrows
SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1);
SetIndexArrow(0,233);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_ARROW,STYLE_DOT,1);
SetIndexArrow(1,234);
SetIndexBuffer(1,ExtMapBuffer2);
// Data window
IndicatorShortName(«Fractal Zig Zag No Repaint»);
SetIndexLabel(0,«Fractal Up»);
SetIndexLabel(1,«Fractal Down»);
// Chart offset calculation
switch(Period())
{
case 1: nShift = 1; break;
case 5: nShift = 3; break;
case 15: nShift = 5; break;
case 30: nShift = 10; break;
case 60: nShift = 15; break;
case 240: nShift = 20; break;
case 1440: nShift = 80; break;
case 10080: nShift = 100; break;
case 43200: nShift = 200; break;
}
nShift=nShift*2;
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
// Start, limit, etc…
int start=0;
int limit;
int counted_bars=IndicatorCounted();
// nothing else to do?
if(counted_bars<0)
return(-1);
// do not check repeated bars
limit=Bars-1-counted_bars;
// Check if ignore bar 0
if(CalculateOnBarClose==true) start=0;
// Check the signal foreach bar from past to present
for(int i=limit; i>=start; i--)
{
// Zig Zag high
double zzhighn=iCustom(Symbol(),0,«ZigZag»,ZZDepth,ZZDev,ZZBack,1,i);
if(zzhighn!=0) zzhigh=zzhighn;
// Last fractals
double resistance=upper_fractal(i);
double support=lower_fractal(i);
//--------------------------------------------------------
// Show signals
//--------------------------------------------------------
// Show signal if it is a fractal and matches last zigzag high value
if(fr_support_change==true && fr_support==zzlow)
{
// Show arrow on fractal and pricetag
ExtMapBuffer1[i+2]=fr_support-nShift*Point;
}
else
// Show signal if it is a fractal and matches last zigzag low value
if(fr_resistance_change==true && fr_resistance==zzhigh)
{
// Show arrow on fractal and pricetag
ExtMapBuffer2[i+2]=fr_resistance+nShift*Point;
}
}
return(0);
}
//+------------------------------------------------------------------+
//| Custom code ahead
//+------------------------------------------------------------------+
/**
* Returns fractal resistance
* @param int shift
*/
Dim777777