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 5675
Next
In Process
noob_aka_nk
noob_aka_nk

noob_aka_nk

  • 1 Question
  • 1 Answer
  • 0 Best Answers
  • 20 Points
View Profile
  • 0
noob_aka_nk
Asked: December 29, 20202020-12-29T10:00:34+00:00 2020-12-29T10:00:34+00:00In: Forex Expert Advisors

Why is zero returned instead of the price of the last trade?

  • 0

Good afternoon, there is a reference: it should return “The price at which the last transaction was made”
In fact, these are the lines:
string neededSymbol = “EURUSD”;
Print(SymbolInfoDouble(neededSymbol, SYMBOL_LAST));
Return 0
I tried to substitute Symbol() on different charts instead of explicitly specifying the tool, it turned out the same thing-returns 0

Then I tried the code from this example: last_tick;   if(SymbolInfoTick(Symbol(),last_tick))     {      Print(last_tick.time,”: Bid = “,last_tick.bid,            ” last = “,last_tick.last,”  Volume = “,last_tick.volume);     }   else Print(“SymbolInfoTick() failed, error = “,GetLastError());

The bid is returned, and the remaining fields are zeros.

Accidentally Googled this constant: PRICE_CLOSE
Not very understanding “how and where” it comes from, I tried to do so:
SymbolSelect(neededSymbol, true);Print(PRICE_CLOSE);
Got 1 with any tool…

Right here:  that if this is the first call of the indicator, then it should be added: “If the first call form is used in the indicator, then at the custom indicator start you can additionally indicate data for calculation in its “Parameters” tab. If the “Apply to” parameter is not selected explicitly, the default calculation is based on the values of “Close” prices.”
– Please tell me: where/at what point of the russified MT5 you can find this window with indicators, or how “correctly” you can get the last price for a given instrument?!

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

    1 Answer

    • Voted
    • Oldest
    • Recent
    1. noob_aka_nk

      noob_aka_nk

      • 1 Question
      • 1 Answer
      • 0 Best Answers
      • 20 Points
      View Profile
      noob_aka_nk
      2020-12-29T10:00:39+00:00Added an answer on December 29, 2020 at 10:00 am

      noob_aka_nk:
      Good afternoon, there is a reference: it should return “The price at which the last transaction was made”
      In fact, these are the lines:
      string neededSymbol = “EURUSD”;
      Print(SymbolInfoDouble(neededSymbol, SYMBOL_LAST));
      Return 0
      I tried to substitute Symbol() on different charts instead of explicitly specifying the tool, it turned out the same thing-returns 0

      Then I tried the code from this example: last_tick;   if(SymbolInfoTick(Symbol(),last_tick))     {      Print(last_tick.time,”: Bid = “,last_tick.bid,            ” last = “,last_tick.last,”  Volume = “,last_tick.volume);     }   else Print(“SymbolInfoTick() failed, error = “,GetLastError());

      The bid is returned, and the remaining fields are zeros.

      Accidentally Googled this constant: PRICE_CLOSE
      Not very understanding “how and where” it comes from, I tried to do so:
      SymbolSelect(neededSymbol, true);Print(PRICE_CLOSE);
      Got 1 with any tool…

      Right here:  that if this is the first call of the indicator, then it should be added: “If the first call form is used in the indicator, then at the custom indicator start you can additionally indicate data for calculation in its “Parameters” tab. If the “Apply to” parameter is not selected explicitly, the default calculation is based on the values of “Close” prices.“
      – Please tell me: where/at what point of the russified MT5 you can find this window with indicators, or how “correctly” you can get the last price for a given instrument?!

      Hurry up and make people laugh, here is a “working code” that returns what I want:  just: how to work with the help if there were 3-4-5 options for solving my “problem” in it, and none of them worked… ??!

      PS. I continue to follow the topic, if someone explains to me what I did wrong in the first post – I will be grateful, because in theory it should not be so: if there is documentation , you need to do it according to it. If something from the documentation does not work, then I am doing something fundamentally “wrong”… it didn’t work for me at all, which is scary! ))

      • 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

    Related Questions

    • Brus Agell

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

      • 0 Answers
    • pinupcasinoo

      Pin Up Casino

      • 0 Answers
    • c00l777

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

      • 2 Answers
    • c00l777

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

      • 0 Answers
    • c00l777

      Optimization results differ on different accounts

      • 3 Answers

    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