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 4740
Next
In Process
issah5
issah5

issah5

  • 3 Questions
  • 6 Answers
  • 0 Best Answers
  • 20 Points
View Profile
  • 0
issah5
Asked: December 27, 20202020-12-27T05:29:50+00:00 2020-12-27T05:29:50+00:00In: Forex Expert Advisors

(MQL5) forced operation of the expert Advisor in one character

  • 0

Dear forumchane! Please tell me how to make the expert Advisor (for example, thisone ) work forcibly on one pair, what you need to change, what you can “wrap the code” with”:

– if we select any other pair in the tester, only the one specified in the code works 

– if we throw any other pair on the chart, only the one specified in the code works 

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

    10 Answers

    • Voted
    • Oldest
    • Recent
    1. issah5

      issah5

      • 3 Questions
      • 6 Answers
      • 0 Best Answers
      • 20 Points
      View Profile
      issah5
      2020-12-27T05:30:50+00:00Added an answer on December 27, 2020 at 5:30 am

      Thank you all! I sort of figured it out.

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

      andreifan

      • 0 Questions
      • 12 Answers
      • 0 Best Answers
      • 46 Points
      View Profile
      andreifan
      2020-12-27T05:30:45+00:00Added an answer on December 27, 2020 at 5:30 am

      Konstantin Nikitin:
      Andrey Fandeev: well, let’s get started… Catch a hard binding no matter what case the character is in.

      ))))) Let the author of the topic catch it. I know how to do that.
      And I didn’t start. 
      I just always try to follow the letter of the TOR.
      But I agree – the question in the title really requires clarification from the customer – what he meant. And it is the programmer’s responsibility to ask these questions.

      P. S, I look at everything from The side of a freelance Performer.

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

      iks_

      • 1 Question
      • 29 Answers
      • 0 Best Answers
      • 78 Points
      View Profile
      iks_
      2020-12-27T05:30:34+00:00Added an answer on December 27, 2020 at 5:30 am

      Andrei Fandeev:

      Your code will allow you to work with a different symbol, if the broker has a symbol with the prefix, Eurusd_c
      You need to check full compliance.

      That’s exactly what allows it. There are situations, especially on cents, when you need to limit the currency pair, and in the set all the characters with prefixes. Therefore, a hard binding to a single character is not quite correct.

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

      andreifan

      • 0 Questions
      • 12 Answers
      • 0 Best Answers
      • 46 Points
      View Profile
      andreifan
      2020-12-27T05:30:29+00:00Added an answer on December 27, 2020 at 5:30 am

      Konstantin Nikitin:

      Check in OnInit, set the enable / disable flag and check its value in the same OnTick. It is allowed to work, but there is no work at all.

      Your code will allow you to work with a different symbol, if the broker has a symbol with the prefix, Eurusd_c
      You need to check full compliance.

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

      issah5

      • 3 Questions
      • 6 Answers
      • 0 Best Answers
      • 20 Points
      View Profile
      issah5
      2020-12-27T05:30:21+00:00Added an answer on December 27, 2020 at 5:30 am

      Konstantin Nikitin:

      Prohibit working on all characters except the one you allow. StringFind will help you with this.

      if (StringFind(Symbol(), "EURUSD") != -1){....}

      Thanks! Do you need to wrap each function and data type?

      in OnInit(), OnTick (), bool, etc.

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

      barabashkakvn

      • 8 Questions
      • 171 Answers
      • 0 Best Answers
      • 352 Points
      View Profile
      barabashkakvn
      2020-12-27T05:30:17+00:00Added an answer on December 27, 2020 at 5:30 am

      issah5:
      Thank you all!

      Please note that the example given above is only a General recommendation is to introduce an input parameter. In addition, you need to look at the rest of the code, understand the algorithm and, if necessary, explicitly prescribe access to the specified character from the input parameters.

      That is, one input parameter is usually not enough. 

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

      iks_

      • 1 Question
      • 29 Answers
      • 0 Best Answers
      • 78 Points
      View Profile
      iks_
      2020-12-27T05:30:12+00:00Added an answer on December 27, 2020 at 5:30 am

      Prohibit working on all characters except the one you allow. StringFind will help you with this.

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

      issah5

      • 3 Questions
      • 6 Answers
      • 0 Best Answers
      • 20 Points
      View Profile
      issah5
      2020-12-27T05:30:04+00:00Added an answer on December 27, 2020 at 5:30 am

      Thank you all!

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

      barabashkakvn

      • 8 Questions
      • 171 Answers
      • 0 Best Answers
      • 352 Points
      View Profile
      barabashkakvn
      2020-12-27T05:29:59+00:00Added an answer on December 27, 2020 at 5:29 am

      issah5:

      Dear forumchane! Please tell me how to make the expert Advisor (for example, thisone ) work forcibly on one pair, what you need to change, what you can “wrap the code” with”:

      – if we select any other pair in the tester, only the one specified in the code works 

      – if we throw any other pair on the chart, only the one specified in the code works 

      Specifically for the specified expert Advisor ( N-_Candles_v3), you need to add the input parameter “Trade sybmol“

      //--- input parameter
      input string   InpSymbol      = "AUDUSD";    // Trade sybmol
      //...
      //+------------------------------------------------------------------+
      //| Expert initialization function                                   |
      //+------------------------------------------------------------------+
      int OnInit()
        {
      //---
         m_symbol.Name(InpSymbol);                  // sets symbol name

      and pass this input parameter to the Name method

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

      fxsaber

      • 1 Question
      • 53 Answers
      • 0 Best Answers
      • 140 Points
      View Profile
      fxsaber
      2020-12-27T05:29:54+00:00Added an answer on December 27, 2020 at 5:29 am

      Insert these lines at the beginning of any expert Advisor#define _Symbol2 "EURUSD" // The expert Advisor will only work with this symbol, but OnTick will go from the one on which it is running

      string Symbol2() { return _Symbol2; }
      #define Symbol Symbol2
      #define _Symbol _Symbol2

      • 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

    Related Questions

    • atma1

      Yesterday I updated VMware to version 16.1.0 and the product ...

      • 3 Answers
    • anton_m

      It is not possible to read data from the server ...

      • 6 Answers
    • s22aa

      Tell me what the difference is.

      • 2 Answers
    • areedbreen

      on the chart in the tester one yield and in ...

      • 2 Answers
    • 1006293

      A question about the intersection of moving averages in MQL5

      • 3 Answers

    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