Re: MT4 Indicator requests and ideas

3652
In the image has an example of an indicator that sets the number of times the same color and it sends an alarm and then closes the cycle as in the photo.
Someone can create or indicate an indicator that does as in the photo where in the place of candles followed he has alternating candles.
I put the same candle indicator if anyone can convert it to alternate candles I would greatly appreciate it.

I'm trying to change this indicator that originally it alerts each color change, I want it to alert when I hear an X sequence of candles and preferably put a graphical indicator to be able to parse past charts.

Code: Select all


#property indicator_chart_window
extern string TimeFrameNote="0-CurrentTimeframe, 1-1MIN, 5-5MIN, 15-15MIN, 30-30MIN, 60-1H, 240-4H, 1440-D1, 10080-W1, 43200-MN1";
extern int  TimeFrame = 0;
extern bool Alerts_ON = true;

int
   candle = 0;

datetime LastAlarmTime;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init() 
  {
   LastAlarmTime = TimeCurrent();
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit() 
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   
   int counter;
   string TimeFrameStr; 
//----
   switch(TimeFrame)
     {
      case 0 : TimeFrameStr="Period "+Period(); break;
      case 1 : TimeFrameStr="Period_M1"; break;
      case 5 : TimeFrameStr="Period_M5"; break;
      case 15 : TimeFrameStr="Period_M15"; break;
      case 30 : TimeFrameStr="Period_M30"; break;
      case 60 : TimeFrameStr="Period_H1"; break;
      case 240 : TimeFrameStr="Period_H4"; break;
      case 1440 : TimeFrameStr="Period_D1"; break;
      case 10080 : TimeFrameStr="Period_W1"; break;
      case 43200 : TimeFrameStr="Period_MN1"; break;
     }   
   RefreshRates();
  // int secondsleft = Time[0]+Period()*60-TimeCurrent();
  // int SecondsElaps = TimeCurrent()-Time[0];

   if( LastAlarmTime < Time[0] && Alerts_ON && ChangeColorOk() != "" ){
    Alert( ChangeColorOk() + " " + Symbol() + " " + TimeFrameStr );
    PlaySound("alert.wav");
    LastAlarmTime = Time[0];
   }  
   return(0);
  }
//+------------------------------------------------------------------+
string ChangeColorOk(){
 
 
 string str="";
   if( iClose(Symbol(),PERIOD_CURRENT,1)< iOpen(Symbol(),PERIOD_CURRENT,1) && 
       iClose(Symbol(),PERIOD_CURRENT,2)> iOpen(Symbol(),PERIOD_CURRENT,2 ) )
       {
    candle++;}   
   if( iClose(Symbol(),PERIOD_CURRENT,1)> iOpen(Symbol(),PERIOD_CURRENT,1) && 
       iClose(Symbol(),PERIOD_CURRENT,2)< iOpen(Symbol(),PERIOD_CURRENT,2 ) )
       {
    candle++;}
    if (candle == 2){
    string srt = "8 Velas em sequência";
    candle = 0;
    return(str);}   
   else candle = 0;
return(str);
}

Original code:

Code: Select all

#property copyright "Copyright © 2016 shahed58"
#property link      ""

#property indicator_chart_window
extern string TimeFrameNote="0-CurrentTimeframe, 1-1MIN, 5-5MIN, 15-15MIN, 30-30MIN, 60-1H, 240-4H, 1440-D1, 10080-W1, 43200-MN1";
extern int  TimeFrame = 0;
extern bool Alerts_ON = true;
extern string SoundWAV = "woody2.wav";

datetime LastAlarmTime;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init() 
  {
   LastAlarmTime = iTime(Symbol(),TimeFrame,0);
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit() 
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   
   int counter;
   string TimeFrameStr; 
//----
   switch(TimeFrame)
     {
      case 0 : TimeFrameStr="Period "+Period(); break;
      case 1 : TimeFrameStr="Period_M1"; break;
      case 5 : TimeFrameStr="Period_M5"; break;
      case 15 : TimeFrameStr="Period_M15"; break;
      case 30 : TimeFrameStr="Period_M30"; break;
      case 60 : TimeFrameStr="Period_H1"; break;
      case 240 : TimeFrameStr="Period_H4"; break;
      case 1440 : TimeFrameStr="Period_D1"; break;
      case 10080 : TimeFrameStr="Period_W1"; break;
      case 43200 : TimeFrameStr="Period_MN1"; break;
     }   
   RefreshRates();
  // int secondsleft = Time[0]+Period()*60-TimeCurrent();
  // int SecondsElaps = TimeCurrent()-Time[0];

   if( LastAlarmTime < Time[0] && Alerts_ON && ChangeColorOk() != "" ){
    Alert( ChangeColorOk() + " " + Symbol() + " " + TimeFrameStr );
    PlaySound(SoundWAV);
    LastAlarmTime = iTime(Symbol(),TimeFrame,0);
   }  
   return(0);
  }
//+------------------------------------------------------------------+
string ChangeColorOk(){
 string str="";
   if( iClose(Symbol(),PERIOD_CURRENT,1)< iOpen(Symbol(),PERIOD_CURRENT,1) && 
       iClose(Symbol(),PERIOD_CURRENT,2)> iOpen(Symbol(),PERIOD_CURRENT,2 ) ){
    str = "RED";   
   }    
       
   if( iClose(Symbol(),PERIOD_CURRENT,1)> iOpen(Symbol(),PERIOD_CURRENT,1) && 
       iClose(Symbol(),PERIOD_CURRENT,2)< iOpen(Symbol(),PERIOD_CURRENT,2 ) ){
    str = "GREEN";   
   }    
 return str;     
}
Attachments

Re: MT4 Indicator requests and ideas

3653
PROSPECTING HELP.
I have tried to adapt this indicator to search for the moves in higher ADR charts over 100 pips: (EA, EC, EJ, GA, GC & GU).
As I am not a coder I cannot get it to change and 'lose' the other currencies.
QUESTIONS.
1. Can someone adapt this indicator so that it only shows the pairs above? or
2. Is there a strength prospector that can be adapted for specific pairs?
The idea is simple to get the biggest moves on the biggest moving charts.
Help much appreciated.
TEAMTRADER


Re: MT4 Indicator requests and ideas

3660
Ajiboyf wrote: Fri Jun 29, 2018 4:57 pm Hell All,
TGIF, Mr Tools,
Please assist to at arrows to the PTL Histogram, if you have time please add latest price and MA Methods if practicality allows.
The indicator needs arrows.
As far as adding the latest prices and ma methods due to the way the indicator calculates it's not possible. about the arrows isn't the lines enough?


Who is online

Users browsing this forum: bbookgenius, DVanAssen, Google [Bot], Majestic-12 [Bot], Telegram [Bot], Xxcoincoin and 101 guests