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 1111
In Process
ru
ru

ru

  • 1 Question
  • 0 Answers
  • 0 Best Answers
  • 20 Points
View Profile
  • 0
ru
Asked: December 18, 20202020-12-18T10:07:52+00:00 2020-12-18T10:07:52+00:00

get the type of simulation mode from the Expert Advisor

  • 0
get the type of simulation mode from the Expert Advisor

Good afternoon!

please tell me if it is possible to get the specified subject in the code of the adviser?

it is necessary to disable certain filters in different modeling modes, for example, when testing for closures, it makes no sense to process
functions related to ticks.

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

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. fxsaber

      fxsaber

      • 1 Question
      • 54 Answers
      • 0 Best Answers
      • 134 Points
      View Profile
      fxsaber
      2020-12-18T10:08:02+00:00Added an answer on December 18, 2020 at 10:08 am

      Forum on trading, automatic trading
      systems and testing of trading strategies

      Language features
      mql5, subtleties and techniques

      fxsaber, 2017.11.23
      00:21

      // returns true only if the real tick mode is selected (in the tester)
      // Before using it, there must be at least one ontick called by the tester

      bool IsRealTicks( void )
      {
        MqlTick Tick;
        
        return(SymbolInfoTick(_Symbol, Tick) && (Tick.volume || !(Tick.flags & TICK_FLAG_LAST)));
      }

      Usage example

      // The Expert Advisor will only be tested in real tick mode
      void OnTick()
      {
        static bool IsRemove = true;
        
        if (IsRemove)
        {
          IsRemove = MQLInfoInteger(MQL_TESTER) && !IsRealTicks();
          
          if (IsRemove)
          {
            Print("Real ticks mode is needed!");
            
            ExpertRemove();
            
            return;
          }
        }
        
        //........
      }
      How
      to do this in OnInit (without onTick) – I do not know.

      You can also use mttester.mqh to get all the settings of the Tester in the Expert Advisor, if it is running on a local Agent.

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

      marketeer

      • 1 Question
      • 33 Answers
      • 0 Best Answers
      • 92 Points
      View Profile
      marketeer
      2020-12-18T10:07:57+00:00Added an answer on December 18, 2020 at 10:07 am

      A long time ago (when there was still a service desk), I asked for such a check via the API. They said they didn’t need it. they offered to write their own algorithms for
      determining the mode by time and number of ticks.

      • 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 504
    • Answers 2k
    • Posts 5
    • Comments 0
    • Best Answers 0
    • Users 673
    • 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

    Users

    Brus Agell

    Brus Agell

    • 1 Question
    • 0 Answers
    pinupcasinoo

    pinupcasinoo

    • 1 Question
    • 0 Answers
    JamesSwics

    JamesSwics

    • 0 Questions
    • 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