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 5376
Next
In Process
top2n
top2n

top2n

  • 2 Questions
  • 1 Answer
  • 0 Best Answers
  • 20 Points
View Profile
  • 0
top2n
Asked: December 29, 20202020-12-29T09:43:59+00:00 2020-12-29T09:43:59+00:00In: Forex Expert Advisors

Creating an array class based on historical order data, what’s wrong

  • 0

Good time. 
Where is the error?
void GetHPosition(_hist &Array[])
  {
/ / - - - defining the boundaries of the required trading history
datetime end=TimeCurrent(); / / current server time
datetime start=end-periodseconds(PERIOD_W1);/ / setting the start to a day ago
/ / - - - query the program cache for the desired interval of the trading history
historyselect(start,end);
   int _GetLastError=0;
/ / - - - get the number of transactions in the history
int _positionshtotal=historydealstotal();
/ / - - - get the ticket of the transaction that has the last index in the list
int temp_value= (int)mathmax(_positionshtotal,1);
   ArrayResize(Array,temp_value);

   _ExpertHist=0;
   for(int z=_PositionsHTotal-1; z>=0; z--)
     {
         ulong deal_ticket=HistoryDealGetTicket(z);
        {
         Array[z].magic= HistoryDealGetInteger(deal_ticket,DEAL_MAGIC);
         Array[z].priceopen=HistoryDealGetDouble(deal_ticket,DEAL_PRICE);

         _ExpertHist++;
        }
     }

   temp_value=(int)MathMax(_ExpertHist,1);
   ArrayResize(Array,temp_value);
  }

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

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. vlad143

      vlad143

      • 0 Questions
      • 6 Answers
      • 0 Best Answers
      • 32 Points
      View Profile
      vlad143
      2020-12-29T09:44:09+00:00Added an answer on December 29, 2020 at 9:44 am

       datetime start=end –periodseconds(PERIOD_W1);/ / set the start to a day ago
      So for a day or a week?

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

      prostotrader

      • 0 Questions
      • 16 Answers
      • 0 Best Answers
      • 56 Points
      View Profile
      prostotrader
      2020-12-29T09:44:03+00:00Added an answer on December 29, 2020 at 9:44 am

      if(HistorySelect(start,end))
      {
      }

      The first mistake

      • 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 674
    • 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

    RobertFoeta

    RobertFoeta

    • 0 Questions
    • 0 Answers
    Brus Agell

    Brus Agell

    • 1 Question
    • 0 Answers
    pinupcasinoo

    pinupcasinoo

    • 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