//+------------------------------------------------------------------+ //| MultiStochastics.mq4 | //| wskanaan | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "wskanaan" #property link "http://www.metaquotes.net" #property indicator_separate_window #property indicator_buffers 7 // Number of buffers #property indicator_color1 Blue // Color of the 1st line #property indicator_color2 Red #property indicator_color3 Green #property indicator_color4 Yellow #property indicator_color5 Orange #property indicator_color6 Indigo #property indicator_color7 Violet #property indicator_level1 10 #property indicator_level2 20 #property indicator_level3 50 #property indicator_level4 80 #property indicator_level5 90 #property indicator_minimum 0 #property indicator_maximum 100 double Buf_0[], Buf_1[], Buf_2[], Buf_3[], Buf_4[], Buf_5[], Buf_6[]; extern bool UseM1Stochastic = true; extern int M1K = 14; extern int M1D = 3; extern int M1Slowing = 3; extern bool UseM5Stochastic = true; extern int M5K = 14; extern int M5D = 3; extern int M5Slowing = 3; extern bool UseM15Stochastic = true; extern int M15K = 14; extern int M15D = 3; extern int M15Slowing = 3; extern bool UseM30Stochastic = true; extern int M30K = 14; extern int M30D = 3; extern int M30Slowing = 3; extern bool UseH1Stochastic = true; extern int H1K = 14; extern int H1D = 3; extern int H1Slowing = 3; extern bool UseH4Stochastic = true; extern int H4K = 14; extern int H4D = 3; extern int H4Slowing = 3; extern bool UseDayStochastic = true; extern int DayK = 14; extern int DayD = 3; extern int DaySlowing = 3; //+------------------------------------------------------------------+ //| Creates the array of pair symbols to check | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- SetIndexBuffer(0,Buf_0); // Assigning an array to a buffer SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,1);// Line style SetIndexLabel (0,"M1"); SetIndexBuffer(1,Buf_1); // Assigning an array to a buffer SetIndexStyle (1,DRAW_LINE,STYLE_SOLID,1);// Line style SetIndexLabel (1,"M5"); SetIndexBuffer(2,Buf_2); // Assigning an array to a buffer SetIndexStyle (2,DRAW_LINE,STYLE_SOLID,1);// Line style SetIndexLabel (2,"M15"); SetIndexBuffer(3,Buf_3); // Assigning an array to a buffer SetIndexStyle (3,DRAW_LINE,STYLE_SOLID,1);// Line style SetIndexLabel (3,"M30"); SetIndexBuffer(4,Buf_4); // Assigning an array to a buffer SetIndexStyle (4,DRAW_LINE,STYLE_SOLID,1);// Line style SetIndexLabel (4,"H1"); SetIndexBuffer(5,Buf_5); // Assigning an array to a buffer SetIndexStyle (5,DRAW_LINE,STYLE_SOLID,1);// Line style SetIndexLabel (5,"H4"); SetIndexBuffer(6,Buf_6); // Assigning an array to a buffer SetIndexStyle (6,DRAW_LINE,STYLE_SOLID,1);// Line style SetIndexLabel (6,"D1"); return; } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //---- int Limit = Bars - counted_bars; for(int x = 0; x < Limit; x++) { if(UseM1Stochastic) { Buf_0[x] = iStochastic(Symbol(), PERIOD_M1, M1K, M1D, M1Slowing, MODE_SMA, 0, MODE_MAIN, x); } if(UseM5Stochastic) { Buf_1[x] = iStochastic(Symbol(), PERIOD_M5, M5K, M5D, M5Slowing, MODE_SMA, 0, MODE_MAIN, x); } if(UseM15Stochastic) { Buf_2[x] = iStochastic(Symbol(), PERIOD_M15, M15K, M15D, M15Slowing, MODE_SMA, 0, MODE_MAIN, x); } if(UseM30Stochastic) { Buf_3[x] = iStochastic(Symbol(), PERIOD_M30, M30K, M30D, M30Slowing, MODE_SMA, 0, MODE_MAIN, x); } if(UseH1Stochastic) { Buf_4[x] = iStochastic(Symbol(), PERIOD_H1, H1K, H1D, M1Slowing, MODE_SMA, 0, MODE_MAIN, x); } if(UseH4Stochastic) { Buf_5[x] = iStochastic(Symbol(), PERIOD_H4, H4K, H4D, H4Slowing, MODE_SMA, 0, MODE_MAIN, x); } if(UseDayStochastic) { Buf_6[x] = iStochastic(Symbol(), PERIOD_D1, DayK, DayD, DaySlowing, MODE_SMA, 0, MODE_MAIN, x); } } //---- return(0); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Indicator Curves created:
Indicators Used:
Stochastic oscillator
Custom Indicators Used:
Order Management characteristics:
Other Features: