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 2475
Next
In Process
withoutthetime
withoutthetime

withoutthetime

  • 1 Question
  • 0 Answers
  • 0 Best Answers
  • 20 Points
View Profile
  • 0
withoutthetime
Asked: December 26, 20202020-12-26T12:19:05+00:00 2020-12-26T12:19:05+00:00In: Forex Expert Advisors

Only “Buy” and only ” Sell”

  • 0

Hello, dear community members!

I ask experienced participants to help in the following – I want to add a setting to the expert Advisor that will allow it to make only short or only long trades, or both. In MT4, there is such an option when attaching an expert Advisor in the input parameters,but in MT5 it is not. I will be very grateful for your help!

  • 1 1 Answer
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    1 Answer

    • Voted
    • Oldest
    • Recent
    1. barabashkakvn

      barabashkakvn

      • 7 Questions
      • 162 Answers
      • 0 Best Answers
      • 314 Points
      View Profile
      barabashkakvn
      2020-12-26T12:19:09+00:00Added an answer on December 26, 2020 at 12:19 pm

      withoutthetime:

      Hello, dear community members!

      I ask experienced participants to help in the following – I want to add a setting to the expert Advisor that will allow it to make only short or only long trades, or both. In MT4, there is such an option when attaching an expert Advisor in the input parameters,but in MT5 it is not. I will be very grateful for your help!

      Alternatively, you can implement it via Transfers.

      Sample code: PSI iMA iStochastic

      An enum is declared: 

      //+------------------------------------------------------------------+
      //| Enum Trade                                                       |
      //+------------------------------------------------------------------+
      enum ENUM_TRADE
        {
         buy=0,   // Only BUY
         sell=1,  // Only SELL
         all=2,   // BUY and SELL
        };

      And in the input parameters we specify the restriction:

      input ENUM_TRADE InpTrade=all;                     // Type trade:

      – in this case, the option is selected: “you Can BUY and SELL”.

      And already inside the code, the expert Advisor looks at the inptrade variable when generating a signal and decides whether to skip such a signal or not.

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

    • JeffreySer

      2015 1-72 HOURS Twitter

      • 0 Answers
    • Jerrynug

      Игровые стратегии для бк

      • 0 Answers
    • Brus Agell

      Правельный выбор

      • 0 Answers
    • pinupcasinoo

      Pin Up Casino

      • 0 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 2 Answers

    Users

    JeffreySer

    JeffreySer

    • 1 Question
    • 0 Answers
    Jerrynug

    Jerrynug

    • 1 Question
    • 0 Answers
    Leonardcig

    Leonardcig

    • 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