Could any one convert this mt4 indicator to cTrader?

Created at 29 Sep 2017, 21:37
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
FO

fordswv@gmail.com

Joined 29.09.2017

Could any one convert this mt4 indicator to cTrader?
29 Sep 2017, 21:37


Hi, I use this mt4 breakout indie for my trading but would really like to be able to use it within cTrader. Is there anybody with the expertise here to convert it? Other breakout indies don't match, it needs to be the exact same as this one, its fantastic.

Many thanks, Sam.

//+------------------------------------------------------------------+
//|                                          Support and Resistance  |
//|                                  Copyright © 2004 Barry Stander  |
//|                           Arrows added by Lennoi Anderson, 2015  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004 Barry Stander; Arrow alerts by Lennoi Anderson, 2015."
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Blue
#property indicator_color4 Magenta
#property indicator_width3 2
#property indicator_width4 2

extern int RSIPeriod = 14;
extern double RSIOverbought = 70;
extern double RSIOversold = 30;
extern int CCIPeriod = 14;
extern double CCIBuyLevel = 50;
extern double CCISellLevel = -50;
extern bool Alerts = TRUE;
extern bool ApplyToClose = TRUE;
extern int BarCount = 10000; 

bool HighBreakout = FALSE;
bool HighBreakPending = FALSE;        
bool LowBreakout = FALSE;
bool LowBreakPending = FALSE; 
double LastResistance = 0;
double LastSupport = 0;
double AlertBar;
//---- buffers
double v1[];
double v2[];
double BreakUp[];
double BreakDown[];
double val1;
double val2;
int counter1;
int counter2;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+  
int init()
{
//---- drawing settings
   SetIndexArrow(0, 119);
   SetIndexArrow(1, 119);
//----  
   SetIndexStyle(0, DRAW_ARROW, STYLE_DOT, 0, Red);
   //SetIndexDrawBegin(0, i-1);
   SetIndexBuffer(0, v1);
   SetIndexLabel(0, "Resistance");
//----    
   SetIndexStyle(1, DRAW_ARROW, STYLE_DOT, 0, Blue);
   //SetIndexDrawBegin(1, i-1);
   SetIndexBuffer(1, v2);
   SetIndexLabel(1, "Support");
//---- 
   SetIndexStyle(2, DRAW_ARROW, EMPTY, 2);
   SetIndexArrow(2, 233);
   SetIndexBuffer(2, BreakUp);
//----   
   SetIndexStyle(3, DRAW_ARROW, EMPTY, 2);
   SetIndexArrow(3, 234);
   SetIndexBuffer(3, BreakDown);
   return(0);
}
//+------------------------------------------------------------------+
int start()
{   
//----
   for(int i = BarCount; i >=0; i--)
   {   
       val1 = iFractals(NULL, 0, MODE_UPPER, i);
       //----
       if(val1 > 0)
       { 
           v1[i] = High[i];
           counter1 = 1;          
       }
       else
       {
           v1[i] = v1[i+1];
           counter1++;           
       }
       val2 = iFractals(NULL, 0, MODE_LOWER, i);
       //----
       if(val2 > 0)
       { 
           v2[i] = Low[i];
           counter2 = 1;     
       }
       else
       {
           v2[i] = v2[i+1];
           counter2++;        
       }
                    
       if (v1[i] != LastResistance) { HighBreakPending = True; LastResistance = v1[i]; }
       if (v2[i] != LastSupport) { LowBreakPending = True; LastSupport = v2[i]; }  
                   
       if (HighBreakPending && Close[i] > v1[i] && iRSI(NULL, 0, RSIPeriod, PRICE_CLOSE, i) < RSIOverbought && 
           iCCI(Symbol(), NULL, CCIPeriod, PRICE_CLOSE, i) > CCIBuyLevel) HighBreakout = TRUE;
       if (LowBreakPending && Close[i] < v2[i] && iRSI(NULL, 0, RSIPeriod, PRICE_CLOSE, i) > RSIOversold && 
           iCCI(Symbol(), NULL, CCIPeriod, PRICE_CLOSE, i) < CCISellLevel) LowBreakout = TRUE; 
           
       if (ApplyToClose) int AlertCandle=1; else AlertCandle=0;         
       
       if (HighBreakout) 
       {          
         if (i>=AlertCandle) BreakUp[i]=Low[i]-10*Point;
         if (Alerts && i==AlertCandle && Bars>AlertBar) 
         { 
           Alert(Symbol(), " M", Period(), " Resistance Breakout: BUY");
           AlertBar = Bars;
         } 
         HighBreakout = False; 
         HighBreakPending = False;
       } else
       if (LowBreakout) 
       { 
         if (i>=AlertCandle) BreakDown[i]=High[i]+10*Point;              
         if (Alerts && i==AlertCandle && Bars>AlertBar)
         {  
           Alert(Symbol(), " M", Period(), " Support Breakout: SELL");
           AlertBar = Bars;
         }
         LowBreakout = False;
         LowBreakPending = False;
       }    
   }  
   return(0);
}

 


@fordswv@gmail.com
Replies

fordswv@gmail.com
29 Sep 2017, 21:39

By the way, here's the link to the indie in case i have posted the code wrong.

http://www.binaryoptionsedge.com/topic/1888-support-and-resistance-barry-with-alert-arrows/#entry84807

thanks again.


@fordswv@gmail.com

MaVe
30 Sep 2017, 10:05

MQ4 to  cAlgo:

http://2calgo.com/


@MaVe

PanagiotisCharalampous
02 Oct 2017, 09:19

Hi fordswv@gmail.com,

Check also our Consultants list. You can find somebody to help you there.

Best Regards,

Panagiotis


@PanagiotisCharalampous