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
Home/ Questions/Q 4049
Next
In Process
arkfatalist
arkfatalist

arkfatalist

  • 5 Questions
  • 4 Answers
  • 0 Best Answers
  • 20 Points
View Profile
  • 0
arkfatalist
Asked: December 26, 20202020-12-26T14:07:01+00:00 2020-12-26T14:07:01+00:00In: Forex Expert Advisors

IndicatorRelease() for the strategy tester. How do I remove an already unnecessary indicator handle in the strategy tester?

  • 0

Good afternoon.

My expert Advisor selects new indicator parameters at regular intervals per day and overwrites them to the same handle. How can I make it forget the previous handle in the strategy tester? And then, the amount of RAM used grows to the limit.

Thank you already.

  • 10 10 Answers
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    10 Answers

    • Voted
    • Oldest
    • Recent
    1. hoz

      hoz

      • 16 Questions
      • 22 Answers
      • 0 Best Answers
      • 32 Points
      View Profile
      hoz
      2020-12-26T14:08:09+00:00Added an answer on December 26, 2020 at 2:08 pm

      Sergey Savinkin:

      Do you really think that the entire data array calculated by the indicator is stored in a primitive type variable? Obviously, int is the index that the EA uses to access the indicator’s handle. Reset the index will not lead to the nullification of the handle. This is what IndicatorRelease () is for. But it doesn’t work in indicators.

      I will not say how it works in MT, but usually, in any other language, for example, Java, any handle is a link, i.e. a pointer. So this pointer can be reset. How it works here, you need to ask the support. The question is even how to check whether it is erased or not. After all, there is no way to run through the handles. Except to remember them and then after deleting check if there is one in the array. But it needs to be checked. And I have schyas head another question puzzled.

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

      savinkins

      • 1 Question
      • 15 Answers
      • 0 Best Answers
      • 46 Points
      View Profile
      savinkins
      2020-12-26T14:08:03+00:00Added an answer on December 26, 2020 at 2:08 pm

      Viktar Dzemikhau:

      I don’t even believe it. Perhaps, somewhere overlooked.. After all, the handle is stored in a primitive type variable. It is elementary to reset the variable.. Tomorrow, if there is time, I will try to do it myself.

      Do you really think that the entire data array calculated by the indicator is stored in a primitive type variable? Obviously, int is the index that the EA uses to access the indicator’s handle. Reset the index will not lead to the nullification of the handle. This is what IndicatorRelease () is for. But it doesn’t work in indicators.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    3. hoz

      hoz

      • 16 Questions
      • 22 Answers
      • 0 Best Answers
      • 32 Points
      View Profile
      hoz
      2020-12-26T14:07:54+00:00Added an answer on December 26, 2020 at 2:07 pm

      Justinas Shimkus:
      The indicators are working fine. Everything you need is created. But that’s an unnecessary handles are not removed. Following the examples from the help-handles of the int type. And that’s how to reset I ask. Tried: IndicatorRelese (), Handle = 0, Handle = NULL, Handle = INVALID_HANDLE. Clogs your memory over time.

      I don’t even believe it. Perhaps, somewhere overlooked.. After all, the handle is stored in a primitive type variable. It is elementary to reset the variable.. Tomorrow, if there is time, I will try to do it myself.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    4. marketeer

      marketeer

      • 1 Question
      • 35 Answers
      • 0 Best Answers
      • 96 Points
      View Profile
      marketeer
      2020-12-26T14:07:42+00:00Added an answer on December 26, 2020 at 2:07 pm

      Justinas Shimkus:

      Alas, memory consumption is also growing to the limit. In addition, it seems that the performance has dropped.

      Then there is only one way out: in the tester mode, make the real parameters of the indicator global variables, track their changes yourself and recalculate the indicator using the same handle / instance.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    5. arkfatalist

      arkfatalist

      • 5 Questions
      • 4 Answers
      • 0 Best Answers
      • 20 Points
      View Profile
      arkfatalist
      2020-12-26T14:07:36+00:00Added an answer on December 26, 2020 at 2:07 pm

      Viktar Dzemikhau:

      If I saw the problem, I think I would have suggested something. In General, everything here is quite elementary.  If the time changes, a Turkey handle is created. This can be done easily. I.e. every new day, a handle is created.

      Input variables can be passed to the indicator as a structure. Accordingly, when you create a handle at the onset of a new day, you create it with the parameters that are needed.. The difficulty is what?

      I was thinking of a similar task too. But I had an idea to write a class to work with a certain type of indicator. It’s quite complicated. Wrote the day z. Well. I needed to make it so that that class could work with some podozhimi types of turkeys with different parameters and names, respectively. The logic is about the same. There is nothing complicated.

      Work then everything will be clear, but there is one BUT. Handles will be collected. And in a week there will already be 5 of them (5 working days). Although, this is also not a problem. In theory, the handle is a variable of type long. It can always be reset to zero. Again, it’s simple))

      The indicators are working fine. Everything you need is created. But that’s an unnecessary handles are not removed. Following the examples from the help-handles of the int type. And that’s how to reset I ask. Tried: IndicatorRelese (), Handle = 0, Handle = NULL, Handle = INVALID_HANDLE. Clogs your memory over time.

      Stanislav Korotky:

      Just an idea – what happens if you call ChartSetSymbolPeriod with the same symbol/period in the tester after changing the indicator parameters?

      Alas, memory consumption is also growing to the limit. In addition, it seems that the performance has dropped.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    6. hoz

      hoz

      • 16 Questions
      • 22 Answers
      • 0 Best Answers
      • 32 Points
      View Profile
      hoz
      2020-12-26T14:07:28+00:00Added an answer on December 26, 2020 at 2:07 pm

      Justinas Shimkus:
      I have parmeters of the indicator for the next day depend on the behavior of the market in the previous one. I.e. every day these parmeters are different.

      If I saw the problem, I think I would have suggested something. In General, everything here is quite elementary.  If the time changes, a Turkey handle is created. This can be done easily. I.e. every new day, a handle is created.

      Input variables can be passed to the indicator as a structure. Accordingly, when you create a handle at the onset of a new day, you create it with the parameters that are needed.. The difficulty is what?

      I was thinking of a similar task too. But I had an idea to write a class to work with a certain type of indicator. It’s quite complicated. Wrote the day z. Well. I needed to make it so that that class could work with some podozhimi types of turkeys with different parameters and names, respectively. The logic is about the same. There is nothing complicated.

      Work then everything will be clear, but there is one BUT. Handles will be collected. And in a week there will already be 5 of them (5 working days). Although, this is also not a problem. In theory, the handle is a variable of type long. It can always be reset to zero. Again, it’s simple))

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    7. marketeer

      marketeer

      • 1 Question
      • 35 Answers
      • 0 Best Answers
      • 96 Points
      View Profile
      marketeer
      2020-12-26T14:07:23+00:00Added an answer on December 26, 2020 at 2:07 pm

      Write to the service Desk.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    8. savinkins

      savinkins

      • 1 Question
      • 15 Answers
      • 0 Best Answers
      • 46 Points
      View Profile
      savinkins
      2020-12-26T14:07:15+00:00Added an answer on December 26, 2020 at 2:07 pm

      I ran into the same problem, but I didn’t find a solution. IndicatorRelease () does not work. I had to transfer the indicator code to the expert Advisor.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    9. arkfatalist

      arkfatalist

      • 5 Questions
      • 4 Answers
      • 0 Best Answers
      • 20 Points
      View Profile
      arkfatalist
      2020-12-26T14:07:10+00:00Added an answer on December 26, 2020 at 2:07 pm

      Viktar Dzemikhau:

      Why is this even necessary? If the handle is received, then it is needed. If you don’t need it, don’t create it..

      I have parmeters of the indicator for the next day depend on the behavior of the market in the previous one. I.e. every day these parmeters are different.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    10. hoz

      hoz

      • 16 Questions
      • 22 Answers
      • 0 Best Answers
      • 32 Points
      View Profile
      hoz
      2020-12-26T14:07:05+00:00Added an answer on December 26, 2020 at 2:07 pm

      Justinas Shimkus:

      Good afternoon.

      My expert Advisor selects new indicator parameters at regular intervals per day and overwrites them to the same handle. How can I make it forget the previous handle in the strategy tester? And then, the amount of RAM used grows to the limit.

      Thank you already.

      Why is this even necessary? If the handle is received, then it is needed. If you don’t need it, don’t create it..

      • 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 521
    • Answers 2k
    • Posts 5
    • Comments 0
    • Best Answers 0
    • Users 706
    • Popular
    • Comments
    • Tags
    • forexcommunity

      Highlighting what’s important about questions & Answers on Discy Community!

      • 0 Comments
    • forexcommunity

      Introducing Keyboard Shortcuts, our first Labs feature

      • 0 Comments
    • forexcommunity

      Defining quality on Discy Engine — what a helpful answer ...

      • 0 Comments
    • forexcommunity

      Organizational and company accounts on Discy Engine the next step

      • 0 Comments
    • forexcommunity

      Hello world!

      • 0 Comments

    Related Questions

    • savinkins

      Getting data by the indicator from another indicator on a ...

      • 6 Answers
    • fresto

      Error opening the OptimOne file error: 5004

      • 2 Answers
    • asot650

      You need to write an Expert Advisor on the indicator

      • 4 Answers
    • miron_like

      Translation to mql5

      • 1 Answer
    • dynamiteman

      Script for commenting on an MT4 or MT5 trade

      • 2 Answers

    Users

    Brianacink

    Brianacink

    • 0 Questions
    • 0 Answers
    asot650

    asot650

    • 1 Question
    • 2 Answers
    investr777

    investr777

    • 1 Question
    • 0 Answers

    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