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

작업 종료됨

실행 시간 4 일
피고용인의 피드백
wonderful client.. thank you for this.
고객의 피드백
Cleaned up my buggy indicator nicely.

명시

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

응답함

1
개발자 1
등급
(362)
프로젝트
506
40%
중재
147
18% / 72%
기한 초과
99
20%
로드됨
2
개발자 2
등급
(130)
프로젝트
210
40%
중재
90
20% / 43%
기한 초과
85
40%
무료
3
개발자 3
등급
(468)
프로젝트
703
56%
중재
45
29% / 31%
기한 초과
115
16%
작업중
4
개발자 4
등급
(69)
프로젝트
93
34%
중재
10
40% / 30%
기한 초과
5
5%
무료
비슷한 주문
I have a indicator, mql file. The signals are seen below on a EURNZD H1 chart. Very important to get accurate entries. The signal to trade is the first tic after the the indicator signal paints. I've tried to demonstrate that below. Other than that the EA will have a lot size escalation, an on-screen pip counter, a button to stop taking new trades, SL/TP, and magic number. I would like the indicator to be within the
I would like to create an EA based on the Shved Supply and Demand indicator. you can find the Shved Supply and Demand v1.7 indicator in the following link https://www.mql5.com/en/code/29395 NB: Checks the trading robot must pass before publication in the Market ( https://www.mql5.com/en/articles/2555 ) MQ5 file to be provided
Hi Guys, I am looking to someone that can generate an indicator for MT4 as explained below. Basically I would need that the indicator point out the price that will close my position in stop out/margin call. The indicator should pick automatically the level of trade out for the broker (which can be different from a broker to another broker) It should write (ideally on the bottom on the left) the following information
Mbeje fx 50+ USD
I like to own my robot that why I want to build my own.i like to be a best to every robot ever in the life to be have more money
I need an MT5 EA that can do the following: I have to give the EA a price in advance, when the price is reached the EA has to automatically place a buy stop or sell stop order 0.5 pips below or above the price. Is this possible
Good day, I want someone to help me create a universal news filter with on/off switch, with start and end settings, and drawdown control with magic number of EAs, etc. Thanks
Hello, I am looking for a professional programmer to optimize my existing EA integrating it with ChatGPT to analyze currencies using various methods to make the right trading decisions. i want it to be an EA that can be trusted to carry trade with the help of chat gpt and also have a very low drawdown
Hello, I am looking for a professional programmer to create a trading expert on the MT4 platform, integrating it with ChatGPT to analyze currencies using various methods to make the right trading decisions. Further details will be provided to the applicants later
I am looking for an experienced MQL5 developer to help me finalize and optimize an Expert Advisor (EA) for the FTMO challenge. I have already built a significant portion of the code, but it requires further refinement and optimization to ensure it functions according to the trading strategy I intend to use. I am happy to share all the resources, including the current code, reference materials, and detailed
dreams good and have a great Cash out from your smart phone , tuyoywuiy glamorous flood see full idk idk slow so dolls stupid sis workouts who's spark koalas oral waits also doggo idk

프로젝트 정보

예산
30+ USD
개발자에게
27 USD