Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

First independent community of traders

First independent community of traders Logo First independent community of traders Logo

First independent community of traders Navigation

  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • Buy Theme
  • Home
  • About Us
  • Blog
  • Contact Us

Share your knowledge in the forex community!

Our community is a completely independent place for communication between forex traders and software developers for trading platforms Metatrader 4 and Metatrader 5

Create A New Account
Home/ Questions/Q 676
In Process
rever27
rever27

rever27

  • 1 Question
  • 1 Answer
  • 0 Best Answers
  • 20 Points
View Profile
  • 0
rever27
Asked: December 18, 20202020-12-18T09:22:42+00:00 2020-12-18T09:22:42+00:00

Error in displaying lines in the basement indicator

  • 0

Hello, I was asked to write code in MQL5, I used to work with it a little, only on MQL4.
I encountered an error that I didn’t understand. There is a code that translates 6 arrays into the buffer of the basement indicator and outputs a value for each given one (in my example, this is 10,20,30,40,50,60). The essence of the code is to draw these lines with each new candle, i.e. at the time of setting the line only on the current bars, then their length will gradually increase, in theory everything is simple. This code works perfectly on MT4, and then a strange thing happens to me-all the lines after the next compilation, the appearance of a new candle or changing the settings, begin to redraw by incomprehensible values, half of the buffers become completely empty, their length becomes different. The error does not appear immediately and I can not understand what could be the cause.
I will attach the code that I am testing, as well as screenshots:
How should be1, How should be2 – how should the indicator display these lines.
Error 1,2,3 – what happens on the chart after the actions described above.

I ask people who understand MT5 to help. Perhaps somewhere you need to update the data of the array, or I have the type of lines is not so set, there are no even guesses, I sin on the MT5 bug. 
I tried 2 different terminals, downloaded the newest ones.
zy. 2 more times there was a moment when throwing the indicator on the chart, he began to calculate something furiously, rebuild the lines and so on for about a minute, then calmed down.

  • 2 2 Answers
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. rever27

      rever27

      • 1 Question
      • 1 Answer
      • 0 Best Answers
      • 20 Points
      View Profile
      rever27
      2020-12-18T09:22:51+00:00Added an answer on December 18, 2020 at 9:22 am

      Maxim Kuznetsov:
      The default buffer indexing is different in 4 and 5. 
      5 ka does not reset the data for the programmer. 
      Just a little more careful you need to be and happiness will come

      can you write more details? 
      My goal is for the buffer to store all the information in itself from the moment the indicator is installed until it is removed from the chart. 

      when initializing, i clean the array twice: arrayfree and arrayinitialize(signal,empty_value);

      while the code is running, i can’t reset it, otherwise all the data that has been in memory since the installation will be erased.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. nektomk

      nektomk

      • 2 Questions
      • 37 Answers
      • 0 Best Answers
      • 92 Points
      View Profile
      nektomk
      2020-12-18T09:22:46+00:00Added an answer on December 18, 2020 at 9:22 am

      Roman Starostin:

      Hello, I was asked to write code in MQL5, I used to work with it a little, only on MQL4.

      I encountered an error that I didn’t understand. There is a code that translates 6 arrays into the buffer of the basement indicator and outputs a value for each given one (in my example, this is 10,20,30,40,50,60). The essence of the code is to draw these lines with each new candle, i.e. at the time of setting the line only on the current bars, then their length will gradually increase, in theory everything is simple. This code works perfectly on MT4, and then a strange thing happens to me-all the lines after the next compilation, the appearance of a new candle or changing the settings, begin to redraw by incomprehensible values, half of the buffers become completely empty, their length becomes different. The error does not appear immediately and I can not understand what could be the cause.

      I will attach the code that I am testing, as well as screenshots:
      How should be1, How should be2 – how should the indicator display these lines.

      Error 1,2,3 – what happens on the chart after the actions described above.

      I ask people who understand MT5 to help. Perhaps somewhere you need to update the data of the array, or I have the type of lines is not so set, there are no even guesses, I sin on the MT5 bug. 

      I tried 2 different terminals, downloaded the newest ones.

      zy. 2 more times there was a moment when throwing the indicator on the chart, he began to calculate something furiously, rebuild the lines and so on for about a minute, then calmed down.

      The default buffer indexing is different in 4 and 5. 
      5 ka does not reset the data for the programmer. 
      Just a little more careful you need to be and happiness will come

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    Leave an answer

    Leave an answer
    Cancel reply

    Browse

    Sidebar

    Ask A Question

    Stats

    • Questions 514
    • Answers 2k
    • Posts 5
    • Comments 0
    • Best Answers 0
    • Users 921
    • Popular
    • Answers
    • Tags
      • On: December 18, 2020
      • Answers: 16

      How to allow trading at certain times

      • On: December 29, 2020
      • Answers: 16

      Example of implementing the OOP pattern Abstract Factory using MQL5 ...

      • On: December 18, 2020
      • Answers: 15

      EMA with a different formula

      • On: December 29, 2020
      • Answers: 15

      Invitation for algo traders.

      • On: December 29, 2020
      • Answers: 14

      Dear Programmers, do not pass by, help fix the error!

    • atma1
      atma1 added an answer Added activation. Thanks. April 8, 2021 at 6:54 am
    • iks_
      iks_ added an answer Atma1: Good day, dear colleagues. Yesterday I updated VMware to… April 8, 2021 at 6:54 am
    • renat
      renat added an answer Atma1: Good day, dear colleagues. Yesterday I updated VMware to… April 8, 2021 at 6:54 am
    • mvs
      mvs added an answer Renat Fatkhullin: You can not immediately send the received data,… April 8, 2021 at 6:53 am
    • anton_m
      anton_m added an answer Renat Fatkhullin: How much data do you read? You can… April 8, 2021 at 6:53 am
    analytics british company computer developers django employee employer english facebook french google interview javascript language life php proforexea programmer programs pro vsa salary university

    Users

    atma1

    atma1

    • 1 Question
    • 1 Answer
    s22aa

    s22aa

    • 1 Question
    • 1 Answer
    areedbreen

    areedbreen

    • 1 Question
    • 1 Answer

    Footer

    First independent community of traders

    About

    An independent community of forex traders. This is where traders communicate. You can ask your questions and you will receive an answer to your question.
    • Terms of Use
    • Privacy Policy
    • Cookie Policy
    • Knowledge Base
    • Support

    © 2021 Forexcommunity.net. All Rights Reserved