Help debug my custom currency strength meter based on my own algo

Job finished

Execution time 4 days
Feedback from employee
wonderful client.. thank you for this.
Feedback from customer
Cleaned up my buggy indicator nicely.

Specification

So as the title suggest, I am looking for someone to debug and briefly explain my errors in my code.

The indicator looks like this on the chart

There are 4 bugs to fix

  1. Indicator applies to the chart fine but doesn't seem to run after initialization.
  2. Indicator only works on 1 hour charts and higher.
  3. Indicator "freezes" on start on new period.
  4. Graphic panel doesn't update to represent indicator value.

Examples of coding include the following

  • Custom strength algo 

   int   i,pos;

////---
   if(rates_total<=1)
      return(0);

////--- preliminary calculation
   if(prev_calculated>1) pos=prev_calculated-1;
   else  pos=1;

   for(i=pos-1; i<rates_total; i++)
     {double eg = 50 + (((iClose("EURGBP",0,i)-iClose("EURGBP",0,(i+Delta)))/(iHigh("EURGBP",0,(iHighest("EURGBP",0,MODE_HIGH,Delta,i)))-iLow("EURGBP",0,(iLowest("EURGBP",0,MODE_LOW,Delta,i)))))*100)/2;
      double ea = 50 + (((iClose("EURAUD",0,i)-iClose("EURAUD",0,(i+Delta)))/(iHigh("EURAUD",0,(iHighest("EURAUD",0,MODE_HIGH,Delta,i)))-iLow("EURAUD",0,(iLowest("EURAUD",0,MODE_LOW,Delta,i)))))*100)/2;
      double en = 50 + (((iClose("EURNZD",0,i)-iClose("EURNZD",0,(i+Delta)))/(iHigh("EURNZD",0,(iHighest("EURNZD",0,MODE_HIGH,Delta,i)))-iLow("EURNZD",0,(iLowest("EURNZD",0,MODE_LOW,Delta,i)))))*100)/2;
      double eu = 50 + (((iClose("EURUSD",0,i)-iClose("EURUSD",0,(i+Delta)))/(iHigh("EURUSD",0,(iHighest("EURUSD",0,MODE_HIGH,Delta,i)))-iLow("EURUSD",0,(iLowest("EURUSD",0,MODE_LOW,Delta,i)))))*100)/2;
      double ec = 50 + (((iClose("EURCAD",0,i)-iClose("EURCAD",0,(i+Delta)))/(iHigh("EURCAD",0,(iHighest("EURCAD",0,MODE_HIGH,Delta,i)))-iLow("EURCAD",0,(iLowest("EURCAD",0,MODE_LOW,Delta,i)))))*100)/2;
      double eh = 50 + (((iClose("EURCHF",0,i)-iClose("EURCHF",0,(i+Delta)))/(iHigh("EURCHF",0,(iHighest("EURGBP",0,MODE_HIGH,Delta,i)))-iLow("EURCHF",0,(iLowest("EURCHF",0,MODE_LOW,Delta,i)))))*100)/2;
      double ej = 50 + (((iClose("EURJPY",0,i)-iClose("EURJPY",0,(i+Delta)))/(iHigh("EURJPY",0,(iHighest("EURJPY",0,MODE_HIGH,Delta,i)))-iLow("EURJPY",0,(iLowest("EURJPY",0,MODE_LOW,Delta,i)))))*100)/2;



      EURBuffer[i] = (eg+ea+en+eu+ec+eh+ej)/7;

//--- and so

  • graphic panel 

//+------------------------------------------------------------------+
//|  Create Panel                                                    |
//+------------------------------------------------------------------+
void CreatePanel()
//+------------------------------------------------------------------+
  {
   string name="label_";

   for(int i=1;i<=24; i++)
     {
      string labelname=name+IntegerToString(i,3,'0');

      switch(i)
        {
         case   1:
            createBarGraph(labelname,264,43,30,2);
            break;
         case   2:
            createBarGraph(labelname,232,43,30,2);
            break;
         case   3:
            createBarGraph(labelname,200,43,30,2);
            break;
   //--- and so on     
  }
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//|  create Bar Graph                                                |
//+------------------------------------------------------------------+
void createBarGraph(string lname,int xdistance,int ydistance,int xsize,int ysize)
//+------------------------------------------------------------------+
  {
   int ypoint=ydistance;
   string name=lname+"_";

   for(int num=51; num>=1; num--)
     {
      createRectangleLabel(name+IntegerToString(num,2,'0'),xdistance,ypoint,xsize,ysize);
      ypoint+=2;
     }
  }
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//|  Create Rectangle Label                                          |
//+------------------------------------------------------------------+
void createRectangleLabel(string name,int xdist,int ydist,int xsize,int ysize,)
  {
   ObjectCreate(name,OBJ_RECTANGLE_LABEL,0,0,0);
   //--- and so on
  }
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//|  Create Edit                                                     |
//+------------------------------------------------------------------+
void createEdit(string name,int xdist,int ydist,int xsize,int ysize,string text,int fontsize,color clr)
//+------------------------------------------------------------------+
  {
   ObjectCreate(name,OBJ_EDIT,0,0,0);
   //--- and so on
  }
//+------------------------------------------------------------------+

  • graphic panel update 

      objectSetBlank("label_001");
      objectSetGraph("label_001_",EURBuffer[0],C'128,128,128',C'134,121,121',C'140,115,115',C'147,108,108',C'153,102,102',C'159,96,96',C'166,89,89',C'172,83,83',C'179,77,77',C'185,70,70',C'191,64,64',C'198,57,57',C'204,51,51',C'210,45,45',C'217,38,38',C'223,32,32',C'230,25,25',C'236,19,19',C'242,13,13',C'249,6,6',C'255,0,0');
      ObjectSetString(0,"label_017",OBJPROP_TEXT,DoubleToString(EURBuffer[0],0));

  • Set graph 

//+------------------------------------------------------------------+
//|  object Set Graph                                                |
//+------------------------------------------------------------------+
void objectSetGraph(string name,double value,color a,color b,color c,color d,color e,color f,color g,color h,color i,color j,color k,color l,color m,color n,color o,color p,color q,color r,color s,color t,color u)
  {
//---
   ObjectSet(name+"51",OBJPROP_COLOR,a);
   if(value > 2.0) ObjectSet(name + "50", OBJPROP_COLOR, a);
   if(value > 4.0) ObjectSet(name + "49", OBJPROP_COLOR, b);
   if(value > 6.0) ObjectSet(name + "48", OBJPROP_COLOR, b);
   if(value > 8.0) ObjectSet(name + "47", OBJPROP_COLOR, c);
   if(value > 10.0) ObjectSet(name + "46", OBJPROP_COLOR, c);
   if(value > 12.0) ObjectSet(name + "45", OBJPROP_COLOR, d);
   if(value > 14.0) ObjectSet(name + "44", OBJPROP_COLOR, d);
   if(value > 16.0) ObjectSet(name + "43", OBJPROP_COLOR, e);
   if(value > 18.0) ObjectSet(name + "42", OBJPROP_COLOR, e);
   if(value > 20.0) ObjectSet(name + "41", OBJPROP_COLOR, f);
   if(value > 22.0) ObjectSet(name + "40", OBJPROP_COLOR, f);

//--- and so on

The full code is 440 lines and will be provided upon expression of interest.

Thank you for your time

Bob

Responded

1
Developer 1
Rating
(362)
Projects
502
40%
Arbitration
145
17% / 73%
Overdue
98
20%
Busy
2
Developer 2
Rating
(130)
Projects
210
40%
Arbitration
90
20% / 43%
Overdue
85
40%
Free
3
Developer 3
Rating
(465)
Projects
694
56%
Arbitration
43
30% / 33%
Overdue
112
16%
Working
4
Developer 4
Rating
(69)
Projects
93
34%
Arbitration
10
40% / 30%
Overdue
5
5%
Free
Similar orders
GOOD DAY DEVELOPERS I NEED A GOOD DEVELOPER WHO HAS AN INDICATOR FOR BOOM AND CRASH UP / DOWN TRENDS FOR ATLEAST 10 CANDLESTICK WITHOUT BEING SPIKED ... TO DEVELOP AN EA BASED ON THAT INDICATOR YOU HAVE, IF YOU HAVE IT PLEASE I AM IN NEED OF IT
Hey greetings My pleasure to met you all .I would like to convert a public tradingview pinescript indicator to MT5 Expert Advisor based on my. Requirements/specification.Kindly bid and let discuss about the project
A robot 30 - 65 USD
Hi I am looking for developer who can make me Mt4 Ea i have 2types of analysis methods i want to add and also want to attach image with Ea like when i attach my to any currency pair the chart changes to my picture Of robot which i attached to my Ea and for proper all settings i want add i will tell u message me
hi.. i have a pin script (TV) but some lines in the code needs to be fixed,,, i will attach the file thanks very much in advance, Also there will be more project in front, so I need a very dedicated developer
Hello, I am looking for a developer to help me convert my mta4 script into trading and make it work perfectly your expertise is highly needed for this project kindly reach out and let's proceed thanks
Develop ctrader 30+ USD
Hi mate, i would like to make Tensorflow.NET dlls (including Keras.NET, NumSharp etc ) from https://scisharp.github.io/SciSharp compatible with cTrader, so i can develop algos inside cTrader. Can you help? Cheers
I want an EA that always trades. Can buy only, sell only, or buy and sell at the same time depending on my selection. It has 5 levels of grid settings. Each grid just contiues onto the next. Not a new grid each time, the settings to continue gridding changes. I have attached an excel file with examples which should be quite self explanatory. INPUTS Initial (first trade) input double StartLot = 0.1; // Starting
I have an EA that makes profit long term, I just need to optimise it across 15+ years and make the profit even better, cut drawdown and overall performance. Only interested to optimise it on ONE PAIR = EURUSD Forex(can add futures too), if you do more pairs, we can negotiate better prices for your order. One condition that must stay: minimum stop loss for Trades must be 3 pips, it can be more but it cant be lower
Hello I am looking for a developer to help me Backtest my tradingview strategy in tradingview platform and make it work perfectly without errors please kindly reach out to so we can proceed
I need a trading system based on ICT trading. The system must be 95% accurate and profitable, it should be reliable and highly effective and must perform market analysis to identify potential trading opportunities. It must analyze the market structure, support and resistance levels. The system must indicate clear entry and exit rules based on the strategy. The system must have buy/sell alert with circle and arrow

Project information

Budget
30+ USD
For the developer
27 USD