Announcement

Collapse
No announcement yet.

Tick Size

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

  • Tick Size

    Does anyone know of a way to retrieve the tick size other than making it a function parameter? I've looked through help and found nothing. I have some algorithms that rely on it and would prefer to retrieve it without making it a parameter.

    Thanks.

  • #2
    Re: Reply to post 'Tick Size'

    I always set a parameter

    if(es)handle=0.25else handle = 0.5

    Comment


    • #3
      I was looking for something broader. I don't want to have a list of every possible symbol to process. It would be bigger than the rest of the efs. I know there is a function to properly format the display price. Something like formatPrice(). Don't remember the exact syntax right now. Thought maybe something might be related to that.

      Thanks.

      Comment


      • #4
        Recently Steve Hare posted an efs named trace that has formatting code examples, but I beleive you are referring to the x.toFixed(2) function for displaying results with 2 decimals - and as a string. Multiplying by 1 converts that string back to a number, fyi.

        Comment


        • #5
          David,

          This is the function to which I was referring.

          formatPriceNumber( nValue )

          This function will return a string with nValue correctly formatted for the chart that is being displayed. This is useful for converting a bar value to a chart display value when working with bonds, notes, currencies or any other instrument that has special formatting requirements.

          It is pretty handy for display values. Works well with every symbol I have tried it on.

          Perhaps it is time for an email to [email protected].

          Thanks.

          Comment


          • #6
            Here is a routine that I came up with to get by until eSignal releases a getTickSize() function. It seems to work. Issues that don't have tight spreads may have problems. I tried it on a few lower volume stocks and got back TkSz of .02. Figure it is a matter of luck whether you find the spread in a short time. For these issues you would just have to run the block longer. Of course fTkSz needs to be initialized to an appropriately large number. I used 1000.

            // TEST BLOCK FOR FINDING TICK SIZE
            if (getBarState() == BARSTATE_NEWBAR)
            {
            iBr++;
            if (iBr < 34)
            {
            fTkSz = fTkSz < getMostRecentAsk() - getMostRecentBid() ?
            fTkSz : getMostRecentAsk() - getMostRecentBid() > 0 ?
            Math.round((getMostRecentAsk() - getMostRecentBid()) * 100) / 100 :
            fTkSz;
            debugPrintln(fTkSz);
            }
            }
            Last edited by Gavishti; 02-03-2004, 01:20 PM.

            Comment

            Working...
            X