Simple Coding Help - No Promise.

Hello Friends

I am starting this thread for helping anyone who requires small changes in AFLs or AFL coding done for small / simple requirements that can be clearly defined.

What does not go is conversion . . . from Amibroker to anything else . . . or from anything else to Amibroker . . .

Debugging requested for copy/paste AFLs, Please don't post huge AFLs with zillions of lines of code for debugging

I will not be available for any conversions and I am not interested in debugging some-one else's copy/pasted work and lastly . . .
Not interested in hacking/craking any ones work . . .

Only if have a clearly definable task to be coded I maybe able to help . . . No Promises but will try within my limitations . . .


As an example, recently one of our friends wanted a motivational message to be included in his Charts,
I enjoyed doing that, as i could easily empathize with why he wanted that . . .


Cheers

:) Happy
how to check in afl which paramfield is chosen by user?
 

vijkris

Learner and Follower
P = ParamField("Price field",0);
How to check in AFL which price field is chosen by user? In above case how to check P i.e. whether it is open, close or else?
See help file for paramfield
 
Hello Experts/Seniors,

Below AFL is to find BUY/SELL Volume with in the same BAR. I picked This AFL from Traderji only:lol::lol:.


PHP:
SetBarsRequired(sbrAll,sbrAll);
 
// BUYING VOLUME AND SELLING VOLUME //
 
BV = IIf( (H==L), 0, V*(C-L)/(H-L) );
SV = IIf( (H==L), 0, V*(H-C)/(H-L) );
 
PlotOHLC(SV,SV,0,0,"SellVolume",colorRed,styleCandle|styleNoTitle|styleNoLabel );
PlotOHLC(SV,BV+SV,SV,BV+SV,"BuyVolume",colorbrightgreen ,styleCandle|styleNoTitle|styleNoLabel );
 
Va = MA(V,30);
 
PlotOHLC( Va, Va, 0, 0, "", ColorBlend( colorWhite , GetChartBkColor(), 0.4 ), styleNoLabel | styleCloud | styleNoRescale, Null, Null, Null, -1 );
Plot(Va,"Average Volume",colorRose,styleNoLine|styleNoLabel );
 
VI = V/Va;
 
Title = "SellVolume:"+WriteVal(SV,5.0)+"   "+"BuyVolume:"+WriteVal(BV,5.0)+"   "+"VolumeIndex:"+WriteVal(VI,1.2)+"   "+
"BuyVolume:"+WriteVal(100*BV/(BV+SV),2.0)+"%"+"   "+"SellVolume:"+WriteVal(100*SV/(BV+SV),2.0)+"%";
Is there any way we can SUM/AVG last 3 bar Volume of BUY/SELL separately excluding Current Running Candle.

Thanks in Advance.:clap::clap:
Any Experts help on this request
 
Any Experts help on this request
Add following segment (shown in bold) in your code...

Code:
BV = IIf( (H==L), 0, [B]Ref(MA([/B]V*(C-L)/(H-L)[B],3),-1)[/B] );
SV = IIf( (H==L), 0, [B]Ref(MA([/B]V*(H-C)/(H-L)[B],3),-1)[/B] );
 
P = ParamField("Price field",0);
How to check in AFL which price field is chosen by user? In above case how to check P i.e. whether it is open, close or else?
No.... It is not possible. ParamField does not return the user choice but transfers the user-choice into a price array reference

In theory, you can compare the price returned by paramfield against individual price arrays such as Open, High, Low and Close but this comparison is not fool proof since different price arrays can have identical values and also, user can choose some other field such as typical price or volume or open interest too.
 
Add following segment (shown in bold) in your code...

Code:
BV = IIf( (H==L), 0, [B]Ref(MA([/B]V*(C-L)/(H-L)[B],3),-1)[/B] );
SV = IIf( (H==L), 0, [B]Ref(MA([/B]V*(H-C)/(H-L)[B],3),-1)[/B] );
Hi mastermind007
Always You try to help where ever is needy. Thanks a lot for your support.:clapping::clapping::clapping:

I have added this code. However its showing values are empty. Can you please take a look at once. attaching the screenshot.

 
Hi mastermind007

I have added this code. However its showing values are empty. Can you please take a look at once. attaching the screenshot.

POINT1
The AFL you have posted on this site does not match with the imgur image posted by you.

POINT2
If you provide 0 as fourth parameter to PlotOHLC function, on what basis do you even expect Amibroker to show you non-zero value?
 
Hello frnds,
Can anyone guide me how to backtest the futures market?
As the futures market have certain expiry and its not practically possible to keep inputting "From and to dates" in backtest setting, can anyone guide how to incorporate this "from and to dates in afl itself and we can add as many dates as possible in it, so that the contract ends on the particular dats and fresh entry can be taken on the from dates.

plz guide me
 
POINT1
The AFL you have posted on this site does not match with the imgur image posted by you.

POINT2
If you provide 0 as fourth parameter to PlotOHLC function, on what basis do you even expect Amibroker to show you non-zero value?
Apologies Mastermind. I have tried to modify using your provided AFL to have last 3 candle avg along with current candle buy/sell volume.

I am not very good at 2nd point. Please find the code that i have tried to modified like imgur posted earlier. Awaiting for your help.

PHP:
_SECTION_BEGIN("Unnamed 2");
SetBarsRequired(sbrAll,sbrAll);
 
// BUYING VOLUME AND SELLING VOLUME //
 //*VALUE BELOW ZERO IS BEARISH, ABOVE ZERO IS BULLISH**//
 
MYINDI=(((C-Ref(C,-1))/(HHV(H,2)-LLV(L,2)))*(V+Ref(V,-1))/2);
 
Plot(EMA(MYINDI,10),"A.N.KUMAR INDICATOR",colorBlack,style=styleDots,Min(0,0),Max(0,0),xshift=0,zorder=0,width=1);
 
 
BV = IIf( (H==L), 0, V*(C-L)/(H-L) );
SV = IIf( (H==L), 0, V*(H-C)/(H-L) );

BV1 = IIf( (H==L), 0, Ref(MA(V*(C-L)/(H-L),3),-1) );
SV1= IIf( (H==L), 0, Ref(MA(V*(H-C)/(H-L),3),-1) );
 
PlotOHLC(SV,SV,0,0,"SellVolume",colorRed,styleCandle|styleNoTitle|styleNoLabel );
PlotOHLC(SV,BV+SV,SV,BV+SV,"BuyVolume",colorBrightGreen ,styleCandle|styleNoTitle|styleNoLabel );
 
Va = MA(V,30);
 
PlotOHLC( Va, Va, 0, 0, "", ColorBlend( colorWhite , GetChartBkColor(), 0.4 ), styleNoLabel | styleCloud | styleNoRescale, Null, Null, Null, -1 );
Plot(Va,"Average Volume",colorRose,styleNoLine|styleNoLabel );
 
VI = V/Va;
 
Title = Date() + "SellVolume:"+WriteVal(SV/100,5.0)+"   "+"BuyVolume:"+WriteVal(BV/100,5.0 )+  "LAST3SellVolume:"+WriteVal(SV1/100,5.0)+"   "+"LAST3BuyVolume:"+WriteVal(BV1/100,5.0 )+"   "+"VolumeIndex:"+WriteVal(VI,1.2)+"   "+
"BuyVolume:"+WriteVal(100*BV/(BV+SV),2.0)+"%"+"   "+"SellVolume:"+WriteVal(100*SV/(BV+SV),2.0)+"%"+ "   "+
"LAST3BuyVolume:"+WriteVal(100*BV1/(BV1+SV1),2.0)+"%"+"   "+"LAST3SellVolume:"+WriteVal(100*SV1/(BV1+SV1),2.0)+"%";
_SECTION_END();
 

Similar threads