Simple Coding Help - No Promise.

Ok

The code you are using for showing OI is this

Code:
_SECTION_BEGIN("Open Interest");
Plot( OpenInt, _DEFAULT_NAME(), ParamColor("Color", colorCycle ), ParamStyle( "Style" ) );
_SECTION_END();
now just add this code to it to get second OI

Code:
_SECTION_BEGIN("OI 2");
Plot(Foreign(ParamStr("Symbol", Name() ),"I"), "OI2", ParamColor("Color 2", colorCycle ), ParamStyle( "Style 2" ) );
_SECTION_END();

you will have to choose the ticker for second OI from parameters



Code:
_SECTION_BEGIN("Open Interest");
Plot( OpenInt, _DEFAULT_NAME(), ParamColor("Color", colorCycle ), ParamStyle( "Style" ) );
_SECTION_END();


_SECTION_BEGIN("OI 2");
Plot(Foreign(ParamStr("Symbol", Name() ),"I"), "OI2", ParamColor("Color 2", colorCycle ), ParamStyle( "Style 2" ) );
_SECTION_END();
Happy :)
 

princy01

Well-Known Member
Sir is it possible to make it automatic functionality to add the oi and volume of opposite side? Suppose it's 8800 call, then 8800 put oi and volume be shown by default along with the call?

Can we add volume also for both items?

In background just like price afl shown in the my screen shot?

Thanks a lot
 
Last edited:
Sir is it possible to make it automatic functionality to add the oi and volume of opposite side? Suppose it's 8800 call, then 8800 out oi and volume be shown by default along with the call?

Can we add volume also for both items?

In background just like price afl shown in the my screen shot?

Thanks a lot

Yes everything is possible, but someone needs to put in efforts . . .

Now if setting a parameter is too much of a task, then
maybe you can put in some efforts to learn a bit of coding

Happy :)
 

hmp

Well-Known Member
Cepetrading
For which time frame are you using this? Here i would request you to pl. change only ribbons, because what have i observed that it gives very good signals for daily time frame.
Regards
 
Hi Friends,

Can somebody make a small change in this afl ?

If the ribbon is blue then candle color should also be blue and if ribbon is red then candle color should also be red.

Thanks a lot
I don't know why you guys just dumb together so much of un-neccesary code . . .

anyway just comment out the Plot(C ... statement in your code and color it with the logic of the ribbon

not changed anything else . . .

Code:
_SECTION_BEGIN("Strategy 9 and 18 ema");
e1=EMA(C,4);
e2=EMA(H,20);
e3=EMA(L,20);
Cover=Buy=b1=Cross(e1,e2);
Short=Sell=s1=Cross(e3,e1);
Buysetup=Flip(b1,s1);
Shortsetup=Flip(s1,b1);
trend=IIf(BarsSince(Buysetup)<BarsSince(Shortsetup ),1,0);
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
Col=IIf(trend==1,colorBlue,colorRed);
//SetBarFillColor(Col);
//Plot(C,"Close",Col,64);
//Shapes
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorGreen, 0,L, Offset=-20);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorRed, 0,H, Offset=-20);
PlotShapes(IIf(Sell, shapeStar, shapeNone),colorYellow, 0,H,35);
PlotShapes(IIf(Cover, shapeStar, shapeNone),colorYellow, 0,L,-35);

_SECTION_BEGIN("Chart Settings");
	SetChartOptions(0,chartShowArrows|chartShowDates);
	//SetChartBkColor(ParamColor("Outer Panel",colorPaleBlue));
	//SetChartBkGradientFill(ParamColor("Upper Chart",1),ParamColor("Lower Chart",23));
	GraphXSpace=Param("GraphXSpace",10,0,100,1);
	dec = (Param("Decimals",2,0,7,1)/10)+1;
	bi = BarIndex();
	Lbi = LastValue(BarIndex());
	sbi = SelectedValue(bi);
	x1= BarCount-1;
Title = EncodeColor(55)+  Title = Name() + "     " + EncodeColor(32) + Date() +
"      " + EncodeColor(5) + "{{INTERVAL}}  " +
	EncodeColor(55)+ "     Open = "+ EncodeColor(52)+ WriteVal(O,dec) + 
	EncodeColor(55)+ "     High = "+ EncodeColor(5) + WriteVal(H,dec) +
	EncodeColor(55)+ "      Low = "+ EncodeColor(32)+ WriteVal(L,dec) + 
	EncodeColor(55)+ "    Close = "+ EncodeColor(52)+ WriteVal(C,dec)+
	EncodeColor(55)+ "    Volume = "+ EncodeColor(52)+ WriteVal(V,1);
_SECTION_END();

_SECTION_BEGIN("trend candle");
////////////////////////////////////
// Heikin_Ashi For Amibroker
////////////////////////////////////

HaClose =EMA((O+H+L+C)/4,3);
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
//PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "Modified " + Name(), colorRed, styleCandle | styleNoLabel );
//SetChartBkGradientFill( ParamColor("BgTop", colorBrightGreen),ParamColor("BgBottom", colorSeaGreen));

_SECTION_END();


_SECTION_BEGIN("Unnamed 3");
pWMA1 = Param("WMA 1 period", 6, 1, 20, 1);
pWMA2 = Param("WMA 2 period", 12, 1, 20, 1);
fMA1 = WMA(HaClose , pWMA1); // calculate MA 1
fMA2 = WMA( (HaOpen + HaClose )/2, pWMA2); // original
//Plot(fMA1, "\nMA1(" + NumToStr(pWMA1, 1.0) + ")", colorWhite| styleThick); // plot the MA lines
//Plot(fMA2, "\nMA2(" + NumToStr(pWMA2, 1.0) + ")", colorBlack|styleThick); // plot the MA lines
Plot( 2, "", IIf( fMA1>fMA2, colorBlue, colorRed),styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );

Col=IIf( fMA1>fMA2,colorBlue,colorRed);
SetBarFillColor(Col);
Plot(C,"Close",Col,64);
_SECTION_END();
Happy :)
 

Similar threads