Announcement

Collapse
No announcement yet.

Tick value auto detect routine

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

  • Tick value auto detect routine

    Could anyone share a few ideas or an actual example of a routine that would detect and return the tick value/size (not actual $ value, but the incremental size of the tick; ie. YM = 1.0, ES = 0.25, EUR = 0.0001) of an instrument? I have searched the forum and was not able to find anything relevant on the subject (if I have missed something, my sincere apologies).

    The typical range for the instruments that I trade will vary from 1, 0.25, 0.1, 0.01, to 0.0001.

    Many thanks!
    Last edited by RuGO; 08-12-2007, 07:03 PM.
    --FOREX--

  • #2
    i use something like this, not elegant but effective

    if ( init == 0 ) {
    sym = getSymbol().charAt(0);
    if ( sym == "N" ){ dec = 2;tic = 0.25;} //nq
    if ( sym == "A" ){ dec = 1;tic = 0.10;} //ab
    if ( sym == "Y" ){ dec = 0;tic = 1.00;} //ym
    if ( sym == "E" ){ dec = 2;tic = 0.25;} //es
    init = 1;}

    Comment


    • #3
      RuGO
      The function getMinTick() returns the minimum tick value of the symbol in the chart
      Alex

      Comment


      • #4
        Never doubt the pros!!! Strangely the syntax did not show in blue in the editor, but it works wonderfully as recommended.

        Many thanks for the advice to both of you!
        --FOREX--

        Comment


        • #5
          RuGO
          It does not highlight in blue in versions 8.0 or earlier simply because the function name was not included in the efs keywords list that was released with those versions. The function itself will work regardless as you have already noticed.
          It has been added to the efs keywords in version 10.0 (currently in public beta) and it will now highlight in blue (see enclosed screenshot)
          Alex

          Comment

          Working...
          X