VELO CENTRATA – Translating mq4 code

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #188459 quote
    Hatsune39
    Participant
    New

    Hi there!

    First of all, thank you for the support you gave me earlier!

    I found this indicator for metatrader, I managed to extract the code but it looks like it’s written with a different language, so it cannot be used with ProRealTime

    Is there a way to translate this? Thanks!

    #property indicator_separate_window
    #property indicator_level1 0
    #property indicator_buffers 1
    #property indicator_color1 Yellow
    
    extern int DurataCiclo = 5;
    extern int MediaVelo = 2;
    extern int Alert = True;
    
    double gda_96[2000];
    double gda_100[2000];
    double gda_104[2000];
    double g_ibuf_108[];
    int g_bars_112 = 1900;
    int g_bars_116 = 0;
    
    int init() {
       SetIndexStyle(0, DRAW_LINE);
       SetIndexBuffer(0, g_ibuf_108);
       string ls_0 = "Target(" + DurataCiclo + ")";
       IndicatorShortName(ls_0);
       SetIndexLabel(0, ls_0);
       return (0);
    }
    
    int deinit() {
       ObjectsDeleteAll();
       Comment("");
       return (0);
    }
    
    int start() {
       
       int ind_counted_4 = 0;//IndicatorCounted();
       int li_8 = DurataCiclo / 1.6180339;
       int li_12 = MediaVelo;
       int li_16 = li_8 / 1.6180339;
       int li_20 = li_12 / 1.6180339;
       
       int barre = Bars;
       
       if (barre <= li_8) return (0);
       if (barre < g_bars_112) g_bars_116 = barre;
       else g_bars_116 = g_bars_112;
       int index_0 = barre - DurataCiclo - 1;
       if (ind_counted_4 >= li_8) index_0 = barre - ind_counted_4 - 1;
       if (index_0 >= g_bars_116) index_0 = g_bars_116 - li_8 - 1;
       while (index_0 >= 0) {
          gda_96[index_0 + li_16] = Open[index_0];
          index_0--;
       }
       for (index_0 = 0; index_0 <= li_16; index_0++) gda_96[index_0] = gda_96[li_16];
       index_0 = barre - li_8 - 1;
       if (ind_counted_4 >= li_8) index_0 = barre - ind_counted_4 - 1;
       if (index_0 >= g_bars_116) index_0 = g_bars_116 - li_8 - 1;
       while (index_0 >= 0) {
          gda_100[index_0] = f0_0(gda_96, li_8, index_0);
          index_0--;
       }
       index_0 = barre - li_12 - 1;
       if (ind_counted_4 >= li_12) index_0 = barre - ind_counted_4 - 1;
       if (index_0 >= g_bars_116) index_0 = g_bars_116 - li_12 - 1;
       while (index_0 >= 0) {
          gda_104[index_0] = gda_100[index_0] - (gda_100[index_0 + 1]);
          index_0--;
       }
       for (index_0 = 0; index_0 <= li_20; index_0++) gda_104[index_0] = gda_104[li_20];
       index_0 = barre - li_12 - 1;
       if (ind_counted_4 >= li_12) index_0 = barre - ind_counted_4 - 1;
       if (index_0 >= g_bars_116) index_0 = g_bars_116 - li_12 - 1;
       while (index_0 >= 0) {
          g_ibuf_108[index_0] = f0_0(gda_104, li_12, index_0);
          index_0--;
       }
       
       return (0);
    }
    
    double f0_0(double ada_0[2000], int ai_4, int ai_8) {
       double ld_ret_12;
       for (int li_20 = ai_8 + 0; li_20 < ai_8 + ai_4; li_20++) ld_ret_12 += ada_0[li_20];
       ld_ret_12 /= ai_4;
       
       ld_ret_12 *= 800;
       
       return (ld_ret_12);
    }
    #188466 quote
    Nicolas
    Keymaster
    Master

    Please provide name of the indicator and pictures in your next message, that fasten the process of the code translation.

    #188467 quote
    Hatsune39
    Participant
    New

    Please provide name of the indicator and pictures in your next message, that fasten the process of the code translation.

    Hi,

    I can give the file itself if it’s better to work on

    VELO-CENTRATA.mq4 VELO-CENTRATA.ex4
    #188652 quote
    Hatsune39
    Participant
    New

    Hi, I managed to get a picture of it. It’s the bottom one!

    Mq4.jpg Mq4.jpg
    #189528 quote
    Hatsune39
    Participant
    New

    Hello, can I ask if there is someone willing to help with this?

    I’d like to translate this myself, but I’m not proficient enough with the language of the two softwares…

    Thank you!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

VELO CENTRATA – Translating mq4 code


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Hatsune39 @hatsune39 Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Hatsune39
3 years, 11 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/18/2022
Status: Active
Attachments: 3 files
Logo Logo
Loading...