Need Help: How to plot Open Interest as candle sticks

#1
Hi All,

I am searching for an AFL which can plot Open Interest as Candle Sticks.

I am getting data from Global data feeds and they provide OI as a line in one of their formula.

It would be great if anyone can help me to plot OI as candles.

The formula in GFDL is:

_SECTION_BEGIN("Open Interest");Plot( OpenInt, _DEFAULT_NAME(), ParamColor("Color", colorTurquoise), ParamStyle( "Style" )|styleOwnScale|styleDashed);_SECTION_END();
 

sr114

Well-Known Member
#2
Hi All,

I am searching for an AFL which can plot Open Interest as Candle Sticks.

I am getting data from Global data feeds and they provide OI as a line in one of their formula.

It would be great if anyone can help me to plot OI as candles.

The formula in GFDL is:

_SECTION_BEGIN("Open Interest");Plot( OpenInt, _DEFAULT_NAME(), ParamColor("Color", colorTurquoise), ParamStyle( "Style" )|styleOwnScale|styleDashed);_SECTION_END();
put this line of code

_SECTION_BEGIN("Open Interest");
Plot( OpenInt, _DEFAULT_NAME(), ParamColor("Color", colorCycle ), 64,ParamStyle( "Style" ) );
_SECTION_END();
to get OI in candle form

rgds
subroto
 
#3
Perhaps I did not make myself very clear as to what I am looking for.

The OI chart should form exactly the same way as the price chart forms. I have attached the screenshot of what I am looking for.

May be someone could help me.
 
Last edited:

sr114

Well-Known Member
#5
to plot Open Interest facing upwards like the price candles

use the following code snippet

Code:
_SECTION_BEGIN("Open Interest");
Plot( -OpenInt, _DEFAULT_NAME(), ParamColor("Color", colorCycle ), 64,ParamStyle( "Style" ) );
_SECTION_END();
rgds
subroto
 
#6
Thanks sr114,

But again, the plotting is similar to the one I have shown in image.

What I am looking for is that the OI plotting should exactly be done as the price candlesticks.

Since the price is a number moving up/down, similarly OI is a number moving up/down. So there should be a way out to plot this number up/down in the exact same manner as the price candle sticks are plotted on the chart.

Thanks again.
 

sr114

Well-Known Member
#8
Thanks sr114,

But again, the plotting is similar to the one I have shown in image.

What I am looking for is that the OI plotting should exactly be done as the price candlesticks.

Since the price is a number moving up/down, similarly OI is a number moving up/down. So there should be a way out to plot this number up/down in the exact same manner as the price candle sticks are plotted on the chart.

Thanks again.
i have given u the idea - now its on ur part to plot the OI just like the price candles ( btw OI does not change so drastically like prices - if so then it will also be depicted as the price candles)

rgds
subroto
 
#10
It should work like this, but I could not try it, as I don't have data of open interest available actually...
Code:
_SECTION_BEGIN("OI Candles");
Color = NULL;
BullColor = ParamColor("BullColor", colorGreen);
BearColor = ParamColor("BearColor", colorRed);
Color = Iif(OpenInt>Ref(OpenInt,-1),BullColor,Iif(OpenInt<Ref(OpenInt,-1),BearColor,Ref(Color,-1)));
PlotOHLC(0,OpenInt,0,OpenInt,"Open Interest",Color, styleCandle | styleOwnScale | styleNoLabel) ;
_SECTION_END();
 

Similar threads

Zerodha – Open Paperless Account

Open online account with Zerodha. Free delivery trading and Max Rs 20 for Intraday, F&O, Currency and Commodity Trading. Intraday High leverage with MIS, CO and BO.

Name:Phone:
Email:City:
State:
Are you a day trader?