Simple Coding Help - No Promise.

I am beginner for coding.I could not find a solution to the problem.

I have SDK line.This is Between 0 and 100. I multiplication this sdk with coefficient.
I want ;

if RSI > 50 and sdk>ref(sdk,-1) then to multiply larger coefficient

if RSI < 50 and sdk<ref(sdk,-1) then to multiply larger coefficient

if RSI > 50 and sdk<ref(sdk,-1) then to multiply smaller coefficient

if RSI < 50 and sdk>ref(sdk,-1) then to multiply smaller coefficien

the rules is above



I try this code but it is not true

sdk1=((sk*a)+(sd*b)+(PFF*y))/(a+y+b);



xx=Param("Periodx",28,50,100,1);
xx=Optimize("Periodx",10,50,100,1);
x=Param("Periodx",10,10,50,1);
x=Optimize("Periodx",10,10,50,1);
sdk=IIf((sdk1>Ref(sdk1,-1)AND RSI(10)>50),TSF(sdk1,xx),TSF(sdk1,x));
 
Last edited:

pratapvb

Well-Known Member
I am beginner for coding.I could not find a solution to the problem.

I have SDK line.This is Between 0 and 100. I multiplication this sdk with coefficient.
I want ;

if RSI > 50 and sdk>ref(sdk,-1) then to multiply larger coefficient

if RSI < 50 and sdk<ref(sdk,-1) then to multiply larger coefficient

if RSI > 50 and sdk<ref(sdk,-1) then to multiply smaller coefficient

if RSI < 50 and sdk>ref(sdk,-1) then to multiply smaller coefficien

the rules is above



I try this code but it is not true

sdk1=((sk*a)+(sd*b)+(PFF*y))/(a+y+b);



xx=Param("Periodx",28,50,100,1);
xx=Optimize("Periodx",10,50,100,1);
x=Param("Periodx",10,10,50,1);
x=Optimize("Periodx",10,10,50,1);
sdk=IIf((sdk1>Ref(sdk1,-1)AND RSI(10)>50),TSF(sdk1,xx),TSF(sdk1,x));
you can't use AND

you will have to put nested iif like

iif (sdk1 > ref(....), iif(rsi(10)>50, one of the results for both greater, result for rsi less while sdk greater),
iif( rsi(10) < 50, results for sdk less and rsi greater, result for both less)) ;
 

Nehal_s143

Well-Known Member
hi

last few day observing that Nifty always retrace to tick average line (Sharkhan Trade tiger) before continuing the trend.



Today also at 1.15 pm, and 2.10 pm price retraced twice till tick average before making new day low.

can we use same tick average in amibroker ? if yes, please share afl code for the same.
 
Last edited:

amitrandive

Well-Known Member
Dear All

Attached volume at Multi price code .Can we modify the code to draw a horizontal line as shown in the sketch at the max volume point?


Code:
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("VAP");
segments = IIf( Interval() < inDaily, Day(), Month() );
segments = segments != Ref( segments , -1 );

PlotVAPOverlayA( segments , Param("Lines", 300, 100, 1000, 1 ), Param("Width", 80, 1, 100, 1 ), ParamColor("Color", colorGold ), ParamToggle("Side", "Left|Right" ) | 2 * ParamToggle("Style", "Fill|Lines", 0) | 4*ParamToggle("Z-order", "On top|Behind", 1 ) );
Plot(segments, "", colorLightGrey, styleHistogram | styleOwnScale );
_SECTION_END();
Any help with this ?
 

trash

Well-Known Member
deal coders

from some another forum i found that its possible to code cumulative delta volume in amibroker and use it successfully on 1sec data? is anybody using it? can anybody post the same?

thks
Basically it's just the difference of bid to ask volume getting cumulated every day or for whole history. As long as you don't have a data source offering according bid ask data then it is pointless to code it anyway.

 

pratapvb

Well-Known Member
hi

last few day observing that Nifty always retrace to tick average line (Sharkhan Trade tiger) before continuing the trend.



Today also at 1.15 pm, and 2.10 pm price retraced twice till tick average before making new day low.

can we use same tick average in amibroker ? if yes, please share afl code for the same.
Wouldn't you need tick data for this?.....once that is there I suppose it is just vwap of n bars on tick
 

Similar threads