//+------------------------------------------------------------------+ //| Arrows_Magic_Buy | //| | //+------------------------------------------------------------------+ #property copyright "Mod Pacois"//Mod Pacois #property link ""//Mod Pacois #property indicator_separate_window #property indicator_buffers 5 #property indicator_color1 Blue #property indicator_color2 Red #property indicator_color3 Green #property indicator_color4 Yellow #property indicator_color5 Red //#property indicator_level1 0 #property indicator_width1 2 #property indicator_width2 2 //#property indicator_width3 2 //#property indicator_maximum 1.1 //#property indicator_minimum -1.1 extern string ______________SetAlert; extern bool ArrowsDn = false; extern bool alertsOn = true; extern bool alertsOnCurrent = true; extern bool alertsMessage = false; extern bool alertsSound = true; extern bool alertsNotify = false; extern bool alertsEmail = false; extern string soundFile = "alert2.wav"; extern string _____________SetArrows; extern bool arrowsVisible = true; extern bool LineVisible = false; extern string arrowsIdentifier = "High_Low_TmaUp "; extern double arrowsDisplaceUp = 1.0; extern double arrowsDisplaceDn = 0.5; extern color arrowsUpColor = Lime; extern color arrowsDnColor = Red; extern int arrowsUpCode = 233; extern int arrowsDnCode = 234; extern int arrowsUpSize = 1; extern int arrowsDnSize = 1; extern bool Histo3 = false; ENUM_TIMEFRAMES timeFrame = 0; extern string _______Alert1Alto________; extern bool BullOn=false; extern bool SoundBull=false; extern string FileSoundBull = "alert.wav"; extern string _______AlertBasso_________; extern double TmaUp = 4.0; extern double RsiUp = 50.0; extern bool BearOn=false; extern bool SoundBear=false; extern string FileSoundBear = "alert2.wav"; int PlayedSoundHBull = False; int PlayedSoundLBear = False; string IndicatorName1 = "High_Low_TmaUp "; // // // // // double rsi1[]; double rsi2[]; double rsi3[]; double rsi4[]; double rsi5[]; double trend[]; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ // // // // // int init() { timeFrame = MathMax(timeFrame,_Period); IndicatorBuffers(6); SetIndexBuffer(0,rsi1);//if(Histo1)SetIndexStyle(0,DRAW_HISTOGRAM,0,2); SetIndexBuffer(1,rsi2);if(Histo3)SetIndexStyle(1,DRAW_HISTOGRAM,0,2); SetIndexBuffer(2,rsi3);if(Histo3)SetIndexStyle(2,DRAW_HISTOGRAM,0,2); SetIndexBuffer(3,rsi4);//if(Histo3)SetIndexStyle(3,DRAW_HISTOGRAM,0,2); SetIndexBuffer(4,rsi5);//if(Histo3)SetIndexStyle(3,DRAW_HISTOGRAM,0,2); SetIndexBuffer(5,trend); // SetLevelValue(1, Level1 ); // SetLevelValue(2, Level2 ); // SetLevelValue(3, Level3 ); // SetLevelValue(4, Level4 ); return(0); } int deinit() { deleteArrows(); return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ // // // // // int start() { int counted_bars=IndicatorCounted(); int i,limit; if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; limit = MathMin(MathMax(Bars-counted_bars,3*timeFrame/_Period),Bars-1); // // // // // // for (i=limit; i >= 0; i--) { // int y = iBarShift(NULL,timeFrame,Time[i]); rsi1[i]= iCustom(NULL,0, "TriangularMA centered Multiple bands",8,i); rsi2[i] = iCustom(NULL,0, "TriangularMA centered Multiple bands",7,i); rsi3[i]= iCustom(NULL,0, "Low-high bands v1.0",3,i); trend[i] = 0; if (rsi1[i]>rsi3[i]&&Close[i]>rsi3[i] ) trend[i]= 1; // if(ArrowsDn) if ( rsi2[i]rsi3[0] ){PlayedSoundLBear = False;} if( Close[0]>rsi3[0] && rsi1[0]>rsi3[0] && PlayedSoundHBull == False){ if(BullOn)Alert(Symbol(), " (", Period(), " min)High_Low_TmaUp |", " Slope | " , " YellowDn | ", "RedDn "); if (SoundBull) PlaySound(FileSoundBull); PlayedSoundHBull = True;} if( Close[0]=0; i--) { string objectName = ObjectName(i); if (StringSubstr(objectName,0,lookForLength) == lookFor) ObjectDelete(objectName); } } // // // // // void deleteArrow(datetime time) { string lookFor = arrowsIdentifier+":"+time; ObjectDelete(lookFor); }