Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

All GomRecorder Indicators

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

    All GomRecorder Indicators

    Hi,

    For convenience purposes I've decided to move all GomRecorder indicator binaries to here.

    Reminder: GomRecorder indicators are developped using the GomRecorderIndicator framework and allow developers to access an emulated OnMarketData() on historical bars.

    This is done using a file that records ticks.


    Here's 1.0 version ; package contains
    • GomRecorderIndicator
    • GomVWAP
    • GomVolumeProfile
    • GomCD
    • GomCDSMA
    • GomCDHA
    • GomDeltaVolume

    I'll document the indicators in this thread

    Package is compatible with 6.5 and 7B5.

    Feel free to contribute !

    EDIT : Added GomFileConverter

    EDIT : version 1.2 contains
    • GomRecorderIndicator
    • GomDeltaIndicator
    • GomVWAP
    • GomVolumeProfile
    • GomCD
    • GomCDMA
    • GomCDHA
    • GomDeltaVolume
    • GomDeltaMomentum

    EDIT : 1.2 nuked, please use 1.3

    EDIT : 1.3b restores NT7 functionnality for GOMCDHA and GOMCDMA

    EDIT : THIS VERSION IS OBSOLETE PLEASE GET VERSION 2.1 HERE
    http://www.bigmiketrading.com/elite-...order-2-a.html
    Attached Files
    Last edited by gomifromparis; 11-29-2010, 07:57 AM.

    #2
    GomRecorderIndicator : the base indicator.

    The purpose of this indicator is to allow the use of a pseudo OnMarketData on historical data.
    To achieve this, a file containing ticks is recorded and reread during historical bar construction.

    WARNING : on opening of the file, GomRecorded checks what is the last date recorded, and it will only record data after this date. So "backfill" using replay files is not possible.

    File formats :
    • There are 3, which are, from more verbose to less verbose : Flat, Short and Binary.
    • Flat format is the only really human-readable format.
    • You can convert from one format to another using the file converter (more on this later)
    • DateTimes are recorded using UTC time zone, allowing to share files between users

    File contents :


    The file contains the ticks with time, volume, and a value to representing where the tick happened in the current bid/ask context.

    The algorithm is :
    Code:
     
    if (ask<bid) // should not happen but does
    { 
         if (price<ask)       tickType=TickTypeEnum.BelowBid;
         else if (price==ask)  tickType=TickTypeEnum.AtAsk;
         else if (price<bid)  tickType=TickTypeEnum.BetweenBidAsk;
         else if (price==bid)  tickType=TickTypeEnum.AtBid;
         else      tickType=TickTypeEnum.AboveAsk;
    }
    else if (bid<ask) //normal case
    {
         if (price<bid)       tickType=TickTypeEnum.BelowBid;
         else if (price==bid) tickType=TickTypeEnum.AtBid;
         else if (price<ask)     tickType=TickTypeEnum.BetweenBidAsk;
         else if (price==ask)  tickType=TickTypeEnum.AtAsk;
         else     tickType=TickTypeEnum.AboveAsk;
    }
    else //bid==ask, should not happen
    {
         if (price<bid)      tickType=TickTypeEnum.BelowBid;
         else if (price>ask)     tickType=TickTypeEnum.AboveAsk;
         else        tickType=tickType=TickTypeEnum.BetweenBidAsk;
    }
    Time recording:
    • Time granularity is the second.
    • If "compress ticks" is set, all ticks occuring at the same second and with the same ticktype are aggregated on one tick with the sum of all aggregated ticks volume.
    • This makes the file smaller but ruins the ability to do volume filtering on the indicators



    File location and naming :
    • Files are stored in My Documents folder, unless you set the GOMFOLDER environment variable, which will be used then.
    • Files are named Instrumentname.FileFormat.txt or .dat


    Time filtering :
    • When Time filtering is on, the recorder doesn't send tick to the indicator outside of session hours.
    • If it is off, all ticks are use, so in all the AH ticks are sent to the first bar of the session.


    Writing flag :
    • Only one of the Recorder derived indicators per instrument is allowed to write in the file. You must indicate which one it is by setting the write flag to true.
    • If the indicator is unable to gain write access, "Recording KO" is showed. Usually typing F5 solves the case and a "Recording OK" should appear.
    • The RecorderIndicator shouln't need to be instantiated on a chart, except as a "recording-only" indicator.

    Smoothing of Volume and Tick charts
    • As the file has a 1 second resolution, there can be a problem on bars that are less than a second long. This can easily happen : for instance, bars that have their volume split by NT are 0 second long.
    • The recorder will try to split volume and ticks on constant volume and tick charts, so that all volume is not sent on only one bar.

    How do I create a GomRecorder Indicator :

    see GomVWAP for an example.
    • Basically you must derive your indicator from GomRecorderIndicator instead of Indicator.
    • Then you must use methods GomInitialize(), GomOnBarUpdate() and GomOnMarketData(TickTypeEnum tickType,double price,int volume) instead of standard NT methods, and you're done.
    • If you need to access the exact time of the tick that is sent, you can use GomOnMarketDataWithTime(DateTime tickTime, TickTypeEnum tickType,double price,int volume,bool firstTickOfBar)
    • All indicators will inheritate all the GomRecorder properties.

    GomVWAP
    • Simple example of GomRecorder indicator.
    • VWAP is reset on the start of a new session.

    GomVolumeProfile
    • This indicator is a GomRecorder modded version of the NT VolumeProfile.
    • If Reinit session is set to true, the values are reset on each session break.
    • You can instantiate one indicator with Reinit Session set to true, and another indicator with Reinit Session set to false with different colors, and in that way you can see both full chart volume and daily volume on the same chart.
    Last edited by gomifromparis; 12-06-2009, 02:33 PM.

    Comment


      #3
      GomCD (Cumulative Delta)

      This indicator is used to plot Delta (volume signed +/- depending if is considered buying volume(+) or selling volume(-).

      The data is plotted in the same format than the main price data : Candlesticks, OHLC and HiLo are supported.

      Calculation Mode
      • BidAsk : if (tick >= ask) the volume is buying ; if (tick <= bid) the volume is selling
      • UpDownTick : if (tick > previous tick) volume is buying ; if (tick < previous) tick volume is selling
      • UpDownTickWithConinuation : if (tick > previous tick) volume is buying and any further volume@tick is buying ; if (tick < previous)tick volume is selling and any further volume@tick is selling

      Delta Calculation
      • CumulativeChart : Delta values are summed bar after bar
      • NonCumulativeChart : Delta is reset on the beginning of each bar.

      Reinit on session break
      • Delta is set to 0 on the beginning of a new session.
      • A Zero Line will be drawn

      Size Filter Mode
      • None: all ticks are used
      • OnlyLargerThan : only ticks with volume strictly larger than Volume Filter Size will be used
      • OnlySmallerThan : only ticks with volume strictly smaller than Volume Filter Size will be used.
      • Size filtering requires that tick compression is disabled.

      Bid/Ask Backup mode
      • If the GomCD is incomplete, you can complete it with some NT extracted data with the file converter.
      • This data doesn't contain bid/ask info, but you can tell the GomCD thas if no Bid/Ask info is available, it must fallback to using UpDownTick or UpDownTickWithContinuation.

      CandleSticks : Enhance HiLo Bars

      This setting doubles the size of the HiLo bar of the candlestick when in candlestick mode.


      CandleSticks : Show Outline

      Enables or disables the drawing of the candlestick outline when in candlestick mode


      Force HiLo for non cumulative

      When in non cumulative mode, forces the GomCD format to HiLo to avoid drawing glitches.


      Forced HiLo Bar size

      When in forced HiLo mode, determines the width of the bars.


      Paint Type
      <U>
      • </U>Determines the color of GomCD bars
      • None : All bars painted with bar outline color
      • UpDown : if (Close > Open) Color is UpColor ; if (Close < Open) Color is DownColor
      • StrongUpDown : if (Close > High[1]) Color is UpColor ; else if (Close < Low[1]) Color is DownColor ; else Color is bar outline color
      Exposed Dataseries

      The GomCD exposes 5 DataSeries for use in other indicators : DeltaClose, DeltaOpen, DeltaHigh, DeltaLow, DeltaValue(=DeltaClose)



      GomCDSMA
      • This is an example of how to use the GomCD values in other indicators : here it is an SMA using the GomCD DeltaClose time series.
      • The SMA can be overlayed over a CD chart


      GomCDHA (Heikin Ashi)
      • This code is an adaptation from ModHA indicator.
      • It's used to plot a Heinkin Ashi version of GomCD
      Last edited by gomifromparis; 12-02-2009, 12:13 PM.

      Comment


        #4
        GomDeltaVolume

        This indicator is another representation of the delta. It is not cumulative.


        Delta Mode

        • True : Shows Abs(Buying Volume - Selling Volume). Resulting bar is green or red depending on Sign(Buying Volume - Selling Volume)
        • False : Shows Buying and Selling volume seperatly, with positive green bars and negative red bars



        Show total volume :

        If True, shows total volume of the bar as a blue bar. Mostly useless if Delta Mode is False.



        GomDeltaBarType

        This indicator will create a new Bar Type (Volume, Time , Range etc) called GomDelta that will construct bars at a constant delta.

        Of course you can't calculate the bid/ask delta in the historical bar construction since bid/ask is not available, so UpDownTickWithContinuation model is used as a proxy.

        Compatible with 6.5 and 7b5
        Attached Files
        Last edited by gomifromparis; 12-15-2009, 05:03 PM.

        Comment


          #5
          GomFileConvert

          Purpose of this stand alone app is to convert data to GomRecorder format.
          It requires the 3.5 Framwork because it uses some Time Zone conversion classes.

          Possible uses include:

          • Converting Binary data to Flat for editing purposes
          • Converting Flat to Binary for size purposes
          • Converting NT, IRT and QCollector files to GomRecorder format for backfill purposes.



          Input File Format :

          Flat, Short, Binary :

          Those are GomRecorder Files


          Ninja :

          Allows converting Ninja export format to GomRecorder format. Bid/Ask won't be available, obviously, but you can use UpTick option in GomCD as a fallback


          IRT :

          Investor R/T format


          Collector :

          Qcollector format. I use this weekly to get a clean file using Qcollector.

          Then I add it to the previous week file using binary add in Windows :
          copy /bin file1.dat+file2.dat file3.dat


          Format is DateTime;Price;Volume;Bid;Ask and looks like this :
          30/11/2009 22:30:26;1093;3;;
          30/11/2009 22:30:26;;;0;1093
          30/11/2009 22:30:27;;;1092,75;0


          Input File Culture, InputFile TZ :

          Use this if you're converting data that comes from a computer in another country


          Compress tick :


          Activates tick compression. Don't use if you're planning to do volume size filtering, as some ticks will be aggregated.


          Tick size:

          Needed for short and binary format as prices aren't recorded as floats but as a number of ticks.
          Attached Files
          Last edited by gomifromparis; 12-06-2009, 02:48 PM.

          Comment


            #6
            Recording KO when using multiple indicators on same instrument.

            I have multiple charts which use the GOMRecorder based indicators. All of them have recording set to false. All of them show Recording OFF status.

            I have a dedicated chart which I use for recording the ticks. All this has the instrument with a range chart (which needs tick data) and the GomRecorderIndicator. This one shows KO and repeated reload NJ (F5) do not help.

            Unfortunately I do not have the debugger installed on this particular machine so can not tell you where, but I think I have a guess. However they still open the file to read it on initialization. I think Windows gives exclusive ownership rights and once a file is opened, even if it is for a read, it will not allow anything else to takeover ownership to write to the file.
            I have confirmed in a debugger that in the GOMRecordIndicator lines 250-256 fails to open the file for writing.

            Code:
            {
             try 
                { 
                                        datafilewrite=File.Open(FileName,FileMode.Append,FileAccess.Write,FileShare.Read);
            writeOK = true;
                 }catch (Exception) { writeOK=false; }
             }
            Workaround:

            I have created a new workspace which is dedicated to saving data. I load that workspace first. Before closing NT, I close all the other workspaces and keep this one active. When NT restarts it opens the recorder workspace first which seems to work fine i terms of not KO the recording. I am not sure that the other indicators will continue to work properly on recorded data (i.e. can they read the data file while it is still being written).
            Last edited by aviat72; 12-03-2009, 12:00 AM.

            Comment


              #7
              The only reason your recording indicator shouldn't be able to gain write access to the file would be that another indicator or process has the write access. The reading indicators don't interfere.

              Please check all indicators, there must be one somwhere with Write=True.

              Comment


                #8
                Gomi,

                You are a Legend... thankyou for sharing your excellent and comprehensive work....

                Comment


                  #9
                  FYI: Editing indicators in the file sharing section now should work again as expected.

                  Comment


                    #10
                    Originally posted by gomifromparis View Post
                    The only reason your recording indicator shouldn't be able to gain write access to the file would be that another indicator or process has the write access. The reading indicators don't interfere.

                    Please check all indicators, there must be one somwhere with Write=True.
                    I have tried various configurations and it was unable to open for write when there were no other indicators writing. All of the charts are templated with recording OFF. I also recreated the scenario on the machine with a debugger (almost a virgin setup with just a few charts), so I am > 95% sure of what was happening.

                    The database files were all zero byte files since they had just been created by the non-recording indicators. I am not sure whether that makes a difference.

                    I am not a Windows expert so do not know how the file-system handle these situations when you have multiple clients reading from a file which is also being written? How is the integrity of the file pointers maintained as file continues to change?

                    Comment


                      #11
                      That's strange... Never seen that... Concerning concurrent file access, there is really no problem to have 1 writer/plenty readers.

                      Comment


                        #12
                        Installed the Gomi Package today and gave it a try. Just brilliant stuff! You are a very generous person to share your work with others. Thank you.

                        Can I throw in a feature request if I may, would you be able to provide an option to anchor the Volume Profile to right or left rather than just the current fixed to left axis.
                        Last edited by TheRightSide; 12-04-2009, 02:28 AM. Reason: poor grammer

                        Comment


                          #13
                          I only took the original NT code an wrapped some Gom methods around to make it GomRecorder compliant. So do some changes would require to actually analyse how it works, and I have little time for that.
                          Sorry

                          Comment


                            #14
                            Gomi,
                            I downloaded the latest package but in both 6.5 & 7 CD fails to retrieve prior intraday values. It displays the current day values but always starts at 0. Got the 'reinit' status to false. I have only one instance of the 'write' recorder status to true, and format is binary.

                            One more thing, is it possible to limit the lookback days in the VolumeProfile?

                            Thanks for the great and generous work.

                            Cheers,
                            SA

                            Comment


                              #15
                              Try disabling the time filter to seen if it has anything to do with it

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by swestendorf, Today, 11:14 AM
                              2 responses
                              5 views
                              0 likes
                              Last Post NinjaTrader_Kimberly  
                              Started by xiinteractive, 04-09-2024, 08:08 AM
                              4 responses
                              12 views
                              0 likes
                              Last Post xiinteractive  
                              Started by Mupulen, Today, 11:26 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post Mupulen
                              by Mupulen
                               
                              Started by Sparkyboy, Today, 10:57 AM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by TheMarlin801, 10-13-2020, 01:40 AM
                              21 responses
                              3,917 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Working...
                              X