Announcement

Collapse
No announcement yet.

OBV.efs Modification help needed!

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

  • OBV.efs Modification help needed!

    Hi Everyone,

    I'm i need of help with OBV (On Balance Volume) on forex. Basically you can't get forex volume from bigger time frames (daily/weekly) but its available on all the smaller time frames (< dailly). So i was wondering if a volume indicator can be modified to collect volume data from smaller time frames in order to put them on a daily or weekly time frame (on an oscillator setting)?

  • #2
    jmidas
    First of all – in case you are not already aware of this – the intraday Volume provided with forex symbols is not actually trade volume but tick volume [ie number of updates in a defined interval]. For more information see the article in the eSignal KnowledgeBase related to forex
    That said it is possible and fairly simple to create a close approximation of daily, weekly, etc volume [and consequently an OBV study] using the intraday volume as the base for the calculations
    The following screenshot shows you how you could do the first part



    Note that I said a “close approximation”. This is because to keep the code simple I make the assumption that the forex day starts at the same time stamp of the daily bar ie at 00:00 of the trade date [rather than at 17:00EST (18:00EDT) of the prior day] and ends at 24:00 [rather than at 17:00EST] of the trade date. That said keep in mind that the volume you would be missing on one side [ie from 17:00EST to 24:00 of the previous day] you gain on the other [ie from 17:00EST to 24:00 of the trade date] so in the end I believe it is a wash from that perspective.
    Copy the code shown in the image above and then save the formula with a name of your choice [eg myFOREXvolume.efs]
    With regards to OBV you need to use a formula that does not rely on the built-in OBV function as that does not accept any source input [it is hard coded to use Volume]. For this purpose you can use the OBV.efs which is provided in the Formulas/Built-in Studies Formulas/Source Formulas. This study also uses Volume but you can replace it with the custom source in this case the modified Volume study shown above.
    To do this change line 35 to the following



    Save the formula with a new name and place it in the same folder in which you saved the myFOREXvolume.efs
    In the following images you can see both the custom volume and custom OBV returing values on Daily and Weekly intervals






    One note regarding the use of these types of formulas
    Keep in mind that depending on the amount of daily, weekly or higher interval bars loaded in the chart the requests for the underlying intraday data can be significant especially if you drill down to smaller intervals and this can impact performance in particular loading times [if for example you load 300 daily bars in your chart that results in a request of over 400,000 one minute bars]. For the purpose of this example I elected to set the custom volume efs to build the volume using 240 minute bars as that provides somewhat of a balance between granularity of data [which as I said before is not actual volume anyhow] and performance. You can however change it as the parameter is user definable
    As an aside to verify how the efs was working I tested it using a 240 minute chart while basing the custom Volume and custom OBV studies on the 5 minute data. The result is shown in the following image



    As you can see the values returned by the custom versions [top two panes] based on 5 minute data match those returned by the built-in studies [bottom two panes] which are instead using the chart’s interval
    Alex


    Originally posted by jmidas View Post
    Hi Everyone,

    I'm i need of help with OBV (On Balance Volume) on forex. Basically you can't get forex volume from bigger time frames (daily/weekly) but its available on all the smaller time frames (< dailly). So i was wondering if a volume indicator can be modified to collect volume data from smaller time frames in order to put them on a daily or weekly time frame (on an oscillator setting)?

    Comment

    Working...
    X