Easylanguage - Print Log function

Discussion in 'Programming' started by gerryhoho, Apr 16, 2012.

  1. Dear all, I have a problem in writing with the Easylanguage - Print Log function which hope there is someone who can kindly help.

    I trade ES myself and I use the Print Log function in order to keep a record of where the level of ES & NQ for every 5 minutes. I have noticed a problem sometimes the data feeded out is different than what I am reading on the real-time quote. At first I thought there is a problem and bug where the system could not catch the data at the right time, but then I found out that it is not the problem with the Easylanguage. It is the different from where it is taking the data from.

    Let me explain it a bit more here:-

    PriceES(Close of Data1),
    PriceNDQ(Close of Data2),
    PriceDJI (Close of Data3),
    PriceDECLQ (Close of Data4),
    PriceADVQ (Close of Data5);

    Vars: StartTimeMins(0), EndTimeMins(0), LastTradeMins(0), Tmins(0);

    if CurrentBar=1 then
    EndTimeMins = TimeToMinutes(Sess1EndTime)-15; //15:00

    Tmins = TimeToMinutes (Time);

    vars: DJIYDC(0), DJILevel(0), ADLevel(1);

    Vars: ESYDC(0), NDQYDC(0), Started(FALSE);
    Vars: ESLevel(0), NDQLevel(0);

    if Date<>Date[1] then
    ESYDC = PriceES[1];
    NDQYDC = PriceNDQ[1];
    DJIYDC = PriceDJI[1];
    Started = TRUE;

    if Started and Tmins >= TimeToMinutes(Sess1StartTime)
    And Tmins <= EndTimeMins then

    ESLevel = PriceES-ESYDC;
    NDQLevel = PriceNDQ-NDQYDC;
    DJILevel = PriceDJI - DJIYDC;
    ADLevel = PriceADVQ/PriceDECLQ;
    Print (Date:0:0,(" "), Time:4:0,(" ES="),ESLevel,(" NQ="),NDQLevel,(" "),ADLevel,(" DJI= "),DJILevel:4:0,);

    Data1: @ES.D
    Data2: @NQ.D
    Data3: $DJI
    Data4: $DECLQ
    Data5: $ADVQ

    The Print Log will take the closing price from the last day closed from the chart. But I noticed that on the real time quote price is calculate using the last settlement price instead and therefore there would be a differences between what¡¯s on the real time and on the Print Log which causing some inaccurate on the data. Do you guys notice that and how would you deal with it?

    All I want is to make my Print Log in line with the real time quote which uses the Settlement price of last quote. Would someone be really kind to let me know how to amend this error please? I would be very thankful if someone can give me a hand on this.

    Thanks Buddies!!!