//+---------------------------------------------------------------------+ //| Copyright © 2008, Robert Hill | //+---------------------------------------------------------------------+ #property copyright "Copyright © 2008, Robert Hill" #property link "" #property indicator_separate_window #property indicator_buffers 8 #property indicator_color1 Red #property indicator_color2 Red #property indicator_color3 Red #property indicator_color4 Red #property indicator_color5 Red #property indicator_color6 Red #property indicator_color7 Red #property indicator_color8 Yellow extern string Sell_currency_pairs = "----- List of Sell currency pairs -----"; extern string mPair_1 = "EURUSD"; extern string mPair_2 = "USDJPY"; extern string mPair_3 = "AUDUSD"; extern string mPair_4 = "NZDJPY"; extern string mPair_5 = "GBPCHF"; extern string mPair_6 = "CHFJPY"; extern string mPair_7 = "EURCHF"; extern int RSI_Period = 14; extern int BarsBack = 100; string Pair1, Pair2, Pair3, Pair4, Pair5, Pair6, Pair7; double Pair1_Buffer[]; double Pair2_Buffer[]; double Pair3_Buffer[]; double Pair4_Buffer[]; double Pair5_Buffer[]; double Pair6_Buffer[]; double Pair7_Buffer[]; double Avg_Buffer[]; int init() { GetCorrectPairs(); SetIndexStyle(0,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(0,Pair1_Buffer); SetIndexLabel(0,Pair1); SetIndexStyle(1,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(1,Pair2_Buffer); SetIndexLabel(1,Pair2); SetIndexStyle(2,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(2,Pair3_Buffer); SetIndexLabel(2,Pair3); SetIndexStyle(3,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(3,Pair4_Buffer); SetIndexLabel(3,Pair4); SetIndexStyle(4,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(4,Pair5_Buffer); SetIndexLabel(4,Pair5); SetIndexStyle(5,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(5,Pair6_Buffer); SetIndexLabel(5,Pair6); SetIndexStyle(6,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(6,Pair7_Buffer); SetIndexLabel(6,Pair7); SetIndexStyle(7,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(7,Avg_Buffer); SetIndexLabel(7,"Sell Avg"); return(0); } int deinit() { return(0); } int start() { int i, limit; int counted_bars = IndicatorCounted(); double Sum; int Num; if(counted_bars < 0) return(-1); //---- last counted bar will be recounted if(counted_bars > 0) counted_bars--; limit=BarsBack; for(i=0; i<limit; i++) { Sum = 0; Num = 0; if (StringLen(Pair1) > 0) { Pair1_Buffer[i] = iRSI(Pair1, 0, RSI_Period, PRICE_CLOSE, i); Sum += Pair1_Buffer[i]; Num++; } if (StringLen(Pair2) > 0) { Pair2_Buffer[i] = iRSI(Pair2, 0, RSI_Period, PRICE_CLOSE, i); Sum += Pair2_Buffer[i]; Num++; } if (StringLen(Pair3) > 0) { Pair3_Buffer[i] = iRSI(Pair3, 0, RSI_Period, PRICE_CLOSE, i); Sum += Pair3_Buffer[i]; Num++; } if (StringLen(Pair4) > 0) { Pair4_Buffer[i] = iRSI(Pair4, 0, RSI_Period, PRICE_CLOSE, i); Sum += Pair4_Buffer[i]; Num++; } if (StringLen(Pair5) > 0) { Pair5_Buffer[i] = iRSI(Pair5, 0, RSI_Period, PRICE_CLOSE, i); Sum += Pair5_Buffer[i]; Num++; } if (StringLen(Pair6) > 0) { Pair6_Buffer[i] = iRSI(Pair6, 0, RSI_Period, PRICE_CLOSE, i); Sum += Pair6_Buffer[i]; Num++; } if (StringLen(Pair7) > 0) { Pair7_Buffer[i] = iRSI(Pair7, 0, RSI_Period, PRICE_CLOSE, i); Sum += Pair7_Buffer[i]; Num++; } Avg_Buffer[i] = Sum / Num; } return(0); } void GetCorrectPairs() { Pair1 = GetCorrectSymbol(mPair_1); Pair2 = GetCorrectSymbol(mPair_2); Pair3 = GetCorrectSymbol(mPair_3); Pair4 = GetCorrectSymbol(mPair_4); Pair5 = GetCorrectSymbol(mPair_5); Pair6 = GetCorrectSymbol(mPair_6); Pair7 = GetCorrectSymbol(mPair_7); } string GetCorrectSymbol(string pair) { string AddChar, myPair; myPair = pair; if (StringLen(pair) > 0) { if (StringLen(Symbol()) == 7) { AddChar = StringSubstr(Symbol(), 6, 1); myPair = pair + AddChar; } } return(myPair); }
Sample
Analysis
Market Information Used:
Indicator Curves created:
Implements a curve of type DRAW_LINE
Indicators Used:
Relative strength index
Custom Indicators Used:
Order Management characteristics:
Other Features: