#property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Cyan #property indicator_color2 Magenta //---- input parameters extern int a=14; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double b4plusdi,b4minusdi,nowplusdi,nowminusdi; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_ARROW,EMPTY,2); SetIndexArrow(0,108); SetIndexBuffer(0, ExtMapBuffer1); SetIndexStyle(1,DRAW_ARROW,EMPTY,2); SetIndexArrow(1,108); SetIndexBuffer(1, ExtMapBuffer2); //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- TODO: add your code here //ObjectDelete(1, DRAW_ARROW,0,0,0); //ObjectDelete(2, DRAW_ARROW,0,0,0); //---- } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int limit; int counted_bars=IndicatorCounted(); //---- check for possible errors if(counted_bars<0) return(-1); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=500; //---- macd counted in the 1-st buffer for(int i=limit; i>=0; i--) { b4plusdi=iCustom(NULL,0,"solar wind mod1",1,i+1); nowplusdi=iCustom(NULL,0,"solar wind mod1",1,i); b4minusdi=iCustom(NULL,0,"solar wind mod1",2,i+1); nowminusdi=iCustom(NULL,0,"solar wind mod1",2,i); //Comment(nowplusdi," ",nowminusdi); if(nowplusdi>0&& b4plusdi==0) { ExtMapBuffer1[i]=Low[i]-1*Point; // if( i<1 )PlaySound("stops.wav"); } if(nowminusdi<0 && b4minusdi==0) { ExtMapBuffer2[i]=High[i]+1*Point; // if (i<1) PlaySound("stops.wav"); } } //---- return(0); }
Sample
Analysis
Market Information Used:
Series array that contains the lowest prices of each bar
Series array that contains the highest prices of each bar
Indicator Curves created:
Implements a curve of type DRAW_ARROW
Indicators Used:
Custom Indicators Used:
solar wind mod1
Order Management characteristics:
Other Features: