EA to collect data each millisecond , not just when Ticks occur -
1 2 3

thread: EA to collect data each millisecond , not just when Ticks occur

  1. #11
    Junior Member piliolo's Avatar
    29
    That script has a flaw it only makes the ea think theres a new sign if the ea doesn't stop it won't see new information. It will make the MT platform operate and look and feel as its working


    Experts and scripts operate with their very own copy of history information. Data of this current emblem are duplied at the very first initiation of the script or professional. At each subsequent initiation of the expert (remember that script is executed only once and doesn't rely on incoming ticks), the initial copy will be updated. One or more new ticks can income while the expert or...
    this script meets my needs - nothing to perform
    that infinite loop on script ship the ticks one per second or how many I want to define and also the EA can operate normally

    when there's a need for assessing the new Bid or other information it is readily done.

    I thought of it but did not try the next thing:

    as soon as I've some activity - let us say a loop in which smth had been triggered - that I can end that loop with break; then ship a tick message to platform then loop so it can initiate a new start() work

    what do you thing men?

  2. #12
    This script has a flaw it only makes the ea believe theres a new tick if the ea doesn't stop it will not see new data. It will produce the MT platform operate and look and feel as its functioning


    Pros and scripts operate with their very own copy of history data. Data of the current emblem are duplied at the very first launch of the script or professional. At every subsequent launch of the expert (recall that script is executed only once and doesn't depend on incoming ticks), the initial copy is going to be upgraded. One or more new ticks can income while the expert or script is functioning, and data can become out of date.



    Thank you 7bit
    simple and simple - like many Fantastic items - better then to utilize any executable that basically does the same

  3. #13
    Cheers, tomorrow I have a more indepth look, is it effortless to get it moving my something? Will run out of rows quickly in glow. .

  4. #14
    Is there a read me with this program?
    This computer software isn't required. The script in the previous post does the exact same thing.

  5. #15
    You can use a tick sender program, like this one:

    http://www.forexmt4.com/Windows prog...nder-Setup.exe

    Basically it let mt4 eas behave like if there is a tick, each x milliseconds (from the software you opt for how many milliseconds let mt4 belive that there is a tick movement), with this you can just write an ea which write stats onto a file and it's going to be implemented every millisecond if you would like.
    Is there a read me for this program? Im trying to have tick by tick bid and ask price information. . Ive downloaded it and installed it but have no clue how to configure it. .

  6. #16
    Inserted Code /** * MT4/experts/scripts/ticks.mq4 * send a fake tick each 200 ms into the chart and * all its indiors and EA until this script is removed. */ #property copyright © Bernd Kreuss #import user32.dll int PostMessageA(int hWnd,int Msg,int wParam,int lParam); int RegisterWindowMessageA(string lpString); #import int start() int hwnd=WindowHandle(Symbol(), Period()); int msg = RegisterWindowMessageA(MetaTrader4_Internal_Messag e); while(! IsStopped()) PostMessageA(hwnd, msg, 2, 1); Sleep(200);
    Want no external software for sending ticks. Attach the above script into a chart and it'll send ticks to this chart. Change the Sleep(200) to make it faster or slower.

  7. #17
    Senior Member sarapano's Avatar
    279
    Why do you need to waste cpu resources with data from every millisecond? You should just need to run a script, ea, work, ect, whenever there is a change in the data. . .Tick, occasion ect... a b = two till the value of a or b changes. Your not likely to get various results.

    This is actually counterproductive because if your in the middle of a loop when a new tick comes in, MT4 will finish the loop prior to starting again using the new tick leading to an additional lag of your calculations.

    My proposal would be to write your code in prep for another tick and execute your transactions the moment you as it comes in using a simple if statement.

    If you are operating a multi currency EA and need to get data from a non chart currency pair you'll require a different alternative. The fastest way I have found to do so is to start a chart for every currency that you are utilizing and execute a script that updates the pricing data to a single file which can be read or common factor in a library.

  8. #18
    Junior Member Emilio1616's Avatar
    25
    I got it to work by just adding some Sleep(1000); The sender software is working like a bomb perfect.

  9. #19
    Junior Member Emilio1616's Avatar
    25
    This is the code I was working on... It kind of dosent work, my aim is to get the potency of a CURRENCY not a currency pair... I thought I should use tick data out of all the different pairs to construct somthing to give indiion about how powerful it is... I wrote the following to your AUD.Im not sure whats wrong tho because each time a tick occures it just carrys on adding numbers. . .Thought this may be usefull to all you guys if you ever have the need to know which currency is the most powerful general.

    Double AUDNZD;
    dual AUDUSD;
    dual AUDCAD;
    dual AUDCHF;
    dual AUDJPY;
    dual EURAUD;
    dual GBPAUD;
    int StrengthAUDNZD = 0;
    int StrengthAUDUSD = 0;
    int StrengthAUDCAD = 0;
    int StrengthAUDCHF = 0;
    int StrengthAUDJPY = 0;
    int StrengthEURAUD = 0;
    int StrengthGBPAUD = 0;
    int StrengthTOTAL = 0;
    int init()

    //--

    //--
    return(0);

    // ------------------------------------------------------------------
    //| pro deinitialization function |
    // ------------------------------------------------------------------
    int deinit()

    //--

    //--
    return(0);

    //p ------------------------------------------------------------------
    //| expert start work |
    // ------------------------------------------------------------------
    int start()

    //--
    AUDNZD = MarketInfo(AUDNZD, MODE_BID);
    AUDUSD = MarketInfo(AUDUSD, MODE_BID);
    AUDCAD = MarketInfo(AUDCAD, MODE_BID);
    AUDCHF = MarketInfo(AUDCHF, MODE_BID);
    AUDJPY = MarketInfo(AUDJPY, MODE_BID);
    EURAUD = MarketInfo(EURAUD, MODE_BID);
    GBPAUD = MarketInfo(GBPAUD, MODE_BID);

    if (MarketInfo(AUDNZD, MODE_BID) ! ) = AUDNZD)

    if (AUDNZD gt; MarketInfo(AUDNZD, MODE_BID)) StrengthAUDNZD = (StrengthAUDNZD 1);
    if (AUDNZD lt; MarketInfo(AUDNZD, MODE_BID)) StrengthAUDNZD = (StrengthAUDNZD - 1);


    if (MarketInfo(AUDUSD, MODE_BID) ! ) = AUDUSD)


    if (AUDUSD gt; MarketInfo(AUDUSD, MODE_BID)) StrengthAUDUSD = (StrengthAUDUSD 1);
    if (AUDUSD lt; MarketInfo(AUDUSD, MODE_BID)) StrengthAUDUSD = (StrengthAUDUSD ( 1);


    if (MarketInfo(AUDCAD, MODE_BID) ! ) = AUDCAD)


    if (AUDCAD gt; MarketInfo(AUDCAD, MODE_BID)) StrengthAUDCAD = (StrengthAUDCAD 1);
    if (AUDCAD lt; MarketInfo(AUDCAD, MODE_BID)) StrengthAUDCAD = (StrengthAUDCAD ( 1);

    if (MarketInfo(AUDCHF, MODE_BID) ! ) = AUDCHF)


    if (AUDCHF gt; MarketInfo(AUDCHF, MODE_BID)) StrengthAUDCHF = (StrengthAUDCHF 1);
    if (AUDCHF lt; MarketInfo(AUDCHF, MODE_BID))StrengthAUDCHF = (StrengthAUDCHF ( 1);


    if (MarketInfo(AUDJPY, MODE_BID) ! ) = AUDJPY)


    if (AUDJPY gt; MarketInfo(AUDJPY, MODE_BID)) StrengthAUDJPY = (StrengthAUDJPY 1);
    if (AUDJPY lt; MarketInfo(AUDJPY, MODE_BID)) StrengthAUDJPY = (StrengthAUDJPY ( 1);


    if (MarketInfo(EURAUD, MODE_BID) ! ) = EURAUD)


    if (EURAUD lt; MarketInfo(EURAUD, MODE_BID)) StrengthEURAUD = (StrengthEURAUD 1);
    if (EURAUD gt; MarketInfo(EURAUD, MODE_BID)) StrengthEURAUD = (StrengthEURAUD ( 1);



    if (MarketInfo(GBPAUD, MODE_BID) ! ) = GBPAUD)


    if (GBPAUD lt; MarketInfo(GBPAUD, MODE_BID)) StrengthGBPAUD = (StrengthGBPAUD 1);
    if (GBPAUD gt; MarketInfo(GBPAUD, MODE_BID)) StrengthGBPAUD = (StrengthGBPAUD ( 1);



    StrengthTOTAL = StrengthAUDNZD StrengthAUDUSD StrengthAUDCAD StrengthAUDCHF StrengthAUDJPY StrengthEURAUD StrengthGBPAUD;

    Monitor(nama, Armand Strauss, 12, 3, 20, Silver, 1);
    Monitor(web, http://www.xlr8ed.biz, 12, 3, 40, Silver, 1);
    Monitor(web1, XLR8ED TRADING, 12, 3, 60, Silver, 1);
    Comment(WindowExpertName(),,
    nnn, AUDNZD Strength:,StrengthAUDNZD,
    n, AUDUSD Strength:,StrengthAUDUSD,
    n, AUDCAD Strength:,StrengthAUDCAD,
    n, AUDCHF Strength:,StrengthAUDCHF,
    n, AUDJPY Strength:,StrengthAUDJPY,
    n, EURAUD Strength:,StrengthEURAUD,
    n, GBPAUD Strength:,StrengthGBPAUD,
    n, TOTAL STRENGTH AUD:,StrengthTOTAL



    );
    //--
    return(0);

    // ------------------------------------------------------------------
    emptiness Monitor(string a_name_0, string a_text_8, int a_fontsize_16, int a_x_20, int a_y_24, color a_color_28, int a_corner_32)
    ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0, 0, 0);
    ObjectSet(a_name_0, OBJPROP_CORNER, a_corner_32);
    ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_20);
    ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_24);
    ObjectSetText(a_name_0, a_text_8, a_fontsize_16, Tahoma, a_color_28);

  10. #20
    Junior Member Emilio1616's Avatar
    25
    Yes I think Tunera has the solution to all of our problems! It works perfectly... It does burn resourses... I7 Extreme here I come

  •