fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    How to Array Auto Fill?

    Questions & Answers
    2
    2
    671
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      casper last edited by

      Hi,

      I tried to fill array automatically. But I can't do this.
      I want to record with array for example every 10 seconds bid price into last 10 minutes.

      I created this array (10 minutes = 60 piece 10 seconds): varbid[60]

      1)Once Per Second Blok : 10
      2)Custom MQL Blok:

      for(int a=0; a<60;a++)
      {
      varbid[a]=MarketInfo(Symbol(),MODE_BID);
      }

      I want to see difirance between varbid[60]- varbid[59] and varbid[59]-varbid[58] and so on....

      how can I do this?

      Thans for your help

      1 Reply Last reply Reply Quote 0
      • Spuzy
        Spuzy last edited by

        this will put the current bid price into every index of the array.

        put this into the custom mql code block:

        for(int a=59;a>0;a--)
        {
           varbid[a]=varbid[a-1];
        }
        varbid[0]=MarketInfo(Symbol(),MODE_BID);
        

        0 is the most recent price so 1 would be the second most recent and so on. 59 being the oldest.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post

        Online Users

        A
        A
        E
        B
        M
        J
        B

        25
        Online

        146.7k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors