Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Volume day trading buy or sell for Amibroker (AFL)

Rating:
3 / 5 (Votes 7)
Tags:
bull, bear, amibroker, volume

This is my first afl code. I have taken from various code and added as one indicator.

It will work good for the intraday. It will give the buy or sell based volume. you can use this additional indicator. It will show which side is having the upper hand for the particular day.

Indicator / Formula

Copy & Paste Friendly
//********Dedicated to my father*************

SetBarsRequired(sbrAll,sbrAll);

// calculate the trading volume
BV = IIf( (H==L), 0, (V*(C-L)/(H-L)) );
SV = IIf( (H==L), 0, (V*(H-C)/(H-L)));

// starting of the day

Bars_so_far_today = 1 + BarsSince( Day() != Ref(Day(), -1));

StartBar = ValueWhen(TimeNum() == 091500, BarIndex());

//total volume traded

TodayVolume = Sum(V,Bars_so_far_today);
 TBUYVOL=Sum(BV,Bars_so_far_today);
 TSELVOL=Sum (SV,Bars_so_far_today);
 SVbull= TBUYVOL>= TSELVOL;
 SVbear=TSELVOL>=TBUYVOL;

 PlotShapes(iif(SVbull,shapeUpArrow, shapeNone),colorGreen, 0, L, Offset=85);
PlotShapes(iif(SVbear,shapedownArrow, shapeNone),colorred, 0, L, Offset=-85);

Title= " Today Volume :"+WriteVal(TodayVolume/1000,2.2)+"  TBUYV :"+WriteVal(TBUYVOL/1000,2.2)+"  TSellV :"+WriteVal(TSELVOL/1000,2.2);

12 comments

1. bsedoha

Good Work.!!!
Thanks for sharing.:)
bsedoah

2. kannan74

good

3. kirthi1987

using amibroker 5.2 version unable to see the additional indicator

4. kamaleshvm

Hi Kirhti,

I have tested and created this code in Amibroker 5.8.
5. FAHIM007

DON’T SEE IN MY AMIBROKER….

6. kamaleshvm

Hi Fahi,

Please add the below code. It will show the chart

Plot( C, “Close”, ParamColor(“Color”, colordefault ), styleNoTitle | GetPriceStyle() );

7. kv_maligi

My rating 5/5.

Did few changes. Modifies code is given below

//********Dedicated to my father*************

SetBarsRequired(sbrAll,sbrAll);

TenkanSen = (HHV(H,9) + LLV(L,9))/2;
KijunSen  = (HHV(H,26)+ LLV(L,26))/2; 
Color_bars =  IIf(Close > KijunSen AND TenkanSen > KijunSen, colorBlue,
              IIf(Close > KijunSen AND TenkanSen < KijunSen,colorCustom11, // Light blue
              IIf(Close < KijunSen AND TenkanSen < KijunSen, colorRed,
              IIf(Close < KijunSen AND TenkanSen > KijunSen, colorCustom12, colorYellow)))); // Darkred & yellow means TenkanSen = KijunSen
Plot( C, "Close", Color_bars, styleBar|styleNoTitle); // TK bars

// calculate the trading volume
BV = IIf( (H==L), 0, (V*(C-L)/(H-L)) );
SV = IIf( (H==L), 0, (V*(H-C)/(H-L)));

// starting of the day

Bars_so_far_today = 1 + BarsSince( Day() != Ref(Day(), -1));
StartBar = ValueWhen(TimeNum() == 091500, BarIndex());

//total volume traded

TodayVolume = Sum(V,Bars_so_far_today);
 TBUYVOL=Sum(BV,Bars_so_far_today);
 TSELVOL=Sum (SV,Bars_so_far_today);
 SVbull= TBUYVOL>= TSELVOL;
 SVbear=TSELVOL>=TBUYVOL;

SVbull = ExRem( SVbull, SVbear );
SVbear = ExRem( SVbear, SVbull ); 

PlotShapes(IIf(SVbull,shapeUpArrow, shapeNone),colorGreen, 0, L, Offset=-35);
PlotShapes(IIf(SVbear,shapeDownArrow, shapeNone),colorRed, 0, L, Offset=-55);

Title= " Today Volume :"+WriteVal(TodayVolume/1000,2.2)+"  TBUYV :"+WriteVal(TBUYVOL/1000,2.2)+"  TSellV :"+WriteVal(TSELVOL/1000,2.2);
8. kamaleshvm

Thanks KV

9. kv_maligi

cut & paste was not done properly. herewith attaching again

//********Dedicated to my father*************

SetBarsRequired(sbrAll,sbrAll);

TenkanSen = (HHV(H,9) + LLV(L,9))/2;
KijunSen  = (HHV(H,26)+ LLV(L,26))/2; 
Color_bars =  IIf(Close > KijunSen AND TenkanSen > KijunSen, colorBlue,
              IIf(Close > KijunSen AND TenkanSen < KijunSen,colorCustom11, // Light blue
              IIf(Close < KijunSen AND TenkanSen < KijunSen, colorRed,
              IIf(Close < KijunSen AND TenkanSen > KijunSen, colorCustom12, colorYellow)))); // Darkred & yellow means TenkanSen = KijunSen
Plot( C, "Close", Color_bars, styleBar|styleNoTitle); // TK bars

// calculate the trading volume
// calculate the trading volume
BV = IIf( (H==L), 0, (V*(C-L)/(H-L)) );
SV = IIf( (H==L), 0, (V*(H-C)/(H-L)));

// starting of the day

Bars_so_far_today = 1 + BarsSince( Day() != Ref(Day(), -1));
StartBar = ValueWhen(TimeNum() == 091500, BarIndex());

//total volume traded

TodayVolume = Sum(V,Bars_so_far_today);
TBUYVOL=Sum(BV,Bars_so_far_today);
TSELVOL=Sum (SV,Bars_so_far_today);
SVbull= TBUYVOL>= TSELVOL;
SVbear=TSELVOL>=TBUYVOL;

SVbull = ExRem( SVbull, SVbear );
SVbear = ExRem( SVbear, SVbull );

PlotShapes(IIf(SVbull,shapeUpArrow, shapeNone),colorGreen, 0, L, Offset=-35);
PlotShapes(IIf(SVbear,shapeDownArrow, shapeNone),colorRed, 0, L, Offset=-55);

Title= " Today Volume :“WriteVal(TodayVolume/1000,2.2)” TBUYV :“WriteVal(TBUYVOL/1000,2.2)” TSellV :"+WriteVal(TSELVOL/1000,2.2);
10. kv_maligi

Plz refer here as it is getting pasted correctly

http://wisestocktrader.com/indicatorpasties/1512-volume-day-trading-buy-sell

11. financial_consultant19

Nice work bro, appreciate. Aapke father ko saalam

12. tkskamlesh

this afl a very useful,
i want 1 request for in afl
please do in afl font size big or small setting..
i min font size setting…
please help me

Leave Comment

Please login here to leave a comment.

Back