Announcement

Collapse
No announcement yet.

BidAskSize.efs

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • BidAskSize.efs

    File Name: BidAskSize.efs

    Description:
    Displays the most recent Bid/Trade/Ask size, relative size and price.

    Formula Parameters:
    None.

    Notes:
    This formula requires build 606 or higher. In addition to size and price, the text color of the trade bar’s (middle bar) labels changes to green if the trade price was at the Ask or higher. If the trade price was at the Bid or lower the text color will be changed to red. If the trade was inside the most recent Bid/Ask prices, the text color will be white. The three bars also display their relative size as a percentage of the sum of the most recent Bid + Trade + Ask sizes.

    Download File:
    BidAskSize.efs



    EFS Code:
    PHP Code:
    /********************************* 
    Provided By : eSignal. (c) Copyright 2003 
    *********************************/ 

    function preMain() { 
        
    setStudyTitle("Bid, Ask and Trade Size"); 
        
    setShowCursorLabel(false); 


    var 
    nBidSize 0
    var 
    nBid null
    var 
    nTradeSize 0
    var 
    nTrade null
    var 
    nAskSize 0
    var 
    nAsk null

    function 
    main() { 
        if (
    getCurrentBarIndex() < || getBuildNumber() < 606) return; 

        
    nAsk getMostRecentAsk(); 
        
    nAskSize getMostRecentAskSize(); 
        
    nTrade close(); 
        
    nTradeSize getMostRecentTradeSize(); 
        
    nBid getMostRecentBid(); 
        
    nBidSize getMostRecentBidSize(); 
        
        if (
    nAsk == null || nAskSize == null || nTrade == null || nTradeSize == null || nBid == null || nBidSize == null) return;
         
        var 
    barA "                    ";  // 20; 
        
    var barT "                    ";  // 20; 
        
    var barB "                    ";  // 20; 
        
    var vColor Color.white
        var 
    Total 100
         
        if (
    nTrade >= nAskvColor Color.green
        if (
    nTrade <= nBidvColor Color.red
         
        var 
    vSpacer " "
        var 
    vTotal nAskSize nTradeSize nBidSize
        var 
    vba****rcent Math.round((nAskSize/vTotal)*100); 
        var 
    vbarTpercent Math.round((nTradeSize/vTotal)*100); 
        var 
    vbarBpercent Math.round((nBidSize/vTotal)*100); 
        for (
    0100; ++i) { 
            if (
    vba****rcent >= ibarA += vSpacer
            if (
    vbarTpercent >= ibarT += vSpacer
            if (
    vbarBpercent >= ibarB += vSpacer
        } 
         
        
    // Relative Size Bars 
        
    drawTextAbsolute(116barA,  
            
    Color.greenColor.greenText.BOLD|Text.BOTTOM|Text.RIGHT|Text.RELATIVETOBOTTOM
             
    null10"Ask bar"); 
        
    drawTextAbsolute(110barT,  
            
    Color.blackColor.blackText.BOLD|Text.VCENTER|Text.RIGHT|Text.RELATIVETOBOTTOM
             
    null10"Trade bar"); 
        
    drawTextAbsolute(14barB,  
            
    Color.redColor.redText.BOLD|Text.TOP|Text.RIGHT|Text.RELATIVETOBOTTOM
             
    null10"Bid bar"); 

        
    // Size Labels 
        
    drawTextAbsolute(016" A SIZE: " nAskSize " "Color.whiteColor.green
             
    Text.ONTOP|Text.BOLD|Text.BOTTOM|Text.LEFT|Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT
             
    null10"Ask size"); 
        
    drawTextAbsolute(010" T  SIZE: " nTradeSize " "vColorColor.black
             
    Text.ONTOP|Text.BOLD|Text.VCENTER|Text.LEFT|Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT
             
    null10"Trade size"); 
        
    drawTextAbsolute(04" B SIZE: " nBidSize " "Color.whiteColor.red
             
    Text.ONTOP|Text.BOLD|Text.TOP|Text.LEFT|Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT
             
    null10"Bid size"); 

        
    // Price Labels 
        
    drawTextAbsolute(116" A: " nAsk.toFixed(4) + " "Color.whiteColor.green
             
    Text.ONTOP|Text.BOLD|Text.BOTTOM|Text.RIGHT|Text.RELATIVETOBOTTOM,  
            
    null10"Ask"); 
        
    drawTextAbsolute(110" T: " nTrade.toFixed(4) + " "vColorColor.black
             
    Text.ONTOP|Text.BOLD|Text.VCENTER|Text.RIGHT|Text.RELATIVETOBOTTOM,  
            
    null10"Trade"); 
        
    drawTextAbsolute(14" B: " nBid.toFixed(4) + " "Color.whiteColor.red
             
    Text.ONTOP|Text.BOLD|Text.TOP|Text.RIGHT|Text.RELATIVETOBOTTOM,  
            
    null10"Bid"); 
         
        return; 

    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation
Working...
X