Announcement

Collapse
No announcement yet.

Can´t get each incoming Bid/Ask size

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can´t get each incoming Bid/Ask size

    I tryed to get the getMostRecentCloseSize, getMostRecentBidSize and the getMostRecentAskSize from an adv. Chart. I wrote this *.efs, to debug the Sizes.

    Problems:
    1.
    I get only "0" for the vTime.getSeconds, never the real seconds between 1-60, why?

    2.
    I have compare the debugged TradeSize, BidSize and the AskSize with the dispayed TradeSize, BidSize/AskSize from a Time and Sales Chart. In the Time and Sales Chart is every incoming trade (tick) shown, but in the debugged TradeSize, BidSize/AskSize not. Can anybody help me, what I get the right second and each BidSize/AskSize and close-Tick?


    var vHour;
    var vMin;
    var vSec;
    var vDay;
    var vMonth;
    var vYear;
    var vTime = new Date();

    function preMain() {
    }
    function main() {
    vTime = getValue("Time");
    vHour = vTime.getHours();
    vMin = vTime.getMinutes();
    vSec = vTime.getSeconds();
    vDay = vTime.getDate();
    vMonth = vTime.getMonth() +1;
    vYear = vTime.getYear();

    debugPrintln(""+vHour+":"+vMin+":"+vSec+"; close: "+close()+" ; T_Size:"+getMostRecentTradeSize()+"; B_Size:A_Size : "+getMostRecentBidSize()+":"+getMostRecentAskSize( )+"");
    }

    Torso


    At the attachment you can see, that I get the trade with the size 41, the next with the size 9 not, also the two trades with the size 10 I have not get.
    Attached Files
    Last edited by Torso; 12-19-2006, 09:59 AM.

  • #2
    Torso
    1. That is happening because in main() you are assigning to vTime the bar time ie getValue("Time") and not the system time and in a minute based chart the seconds in the bar time are always 0.
    To retrieve the system time you need to make the following changes
    PHP Code:
    ...
    //var vTime = new Date();//move this from here...
     
    function preMain() {
    }
    function 
    main() {
        var 
    vTime = new Date();//...to here and ...
        //vTime = getValue("Time");//remove this 
        
    ... 
    Once you have done the above vTime.getSeconds() will return the seconds from the system time.
    2. See this post for an explanation of how an efs executes on minute based charts with certain symbols.
    Alex

    Comment

    Working...
    X