Australian (ASX) Stock Market Forum

No, but i'll check it out thanks GB. :xyxthumbs


Geez GB, how do i get rid of the VWAP now that is on the chart?

You can just //comment// these lines out so they don't plot. I quite like them, but not sure if they have a use yet.

//Prior period VWAP centerline
//PPC = ValueWhen( newPeriod == True, Ref(VWAP, -1), 1);
//Plot ( PPC, "PPC", colorBlue, styleDots|styleNoLine|styleNoRescale );
//Plot ( VWAP, "VWAP", colorBlue, styleLine );
//Plot ( stddev_1_pos, "VWAP_std+1", ColorRGB( 128, 0, 0 ), styleDashed );
//Plot ( stddev_1_neg, "VWAP_std-1", ColorRGB( 0, 128, 0 ), styleDashed );
//Plot ( stddev_2_pos, "VWAP_std+2", colorRed, styleDashed | styleThick );
//Plot ( stddev_2_neg, "VWAP_std-2", colorGreen, styleDashed | styleThick );
//Plot ( stddev_3_pos, "VWAP_std+3", colorDarkRed, styleDots | styleThick );
//Plot ( stddev_3_neg, "VWAP_std-3", colorDarkGreen, styleDots | styleThick );


I think you might prefer Anderson's code, since it includes buy and sell volume color-coded, but you will need the latest version of AB to test it.
 
Hello all,

I just purchased Amibroker along with Norgate Premium Data for ASX end of day data. I worked through Howard Bandy's v. useful "Introduction to Amibroker" publication. My main issue/hurdle is learning how to code using Amibroker's AFL. I have never done anything like this before and thought I'd start gently by attempting to filter for all stocks that have made a new 52 week high for week ending 9 May 2014. I wrote the following in the formula editor (referencing Mr Bandy's example5.afl and modifying to my requirement) :

Liquidity = MA ( C * V, 21 );
New52High = High == HHV ( C, 52 );

Filter = Liquidity >= 100000;
AddColumn ( New52High, "52 High", 1.0 );

I ran an Explore on this - Apply To *All symbols with - Range 1 recent bar(s).
The results gave me stocks which did not reach new 52 week highs as of week ending 9 May. I am honestly clueless. I had set my chart to Weekly for this formula. I had also attempted various iterations by choosing 260 and setting the charts to Daily; removing the liquidity requirement.

I have already searched the Amibroker support site but cannot begin to understand the AFL language that is spoken :( Would appreciate any help or suggestions on where I can get more help in plain english. :banghead:

THanks in advance.
Hi
Hello all,

I just purchased Amibroker along with Norgate Premium Data for ASX end of day data. I worked through Howard Bandy's v. useful "Introduction to Amibroker" publication. My main issue/hurdle is learning how to code using Amibroker's AFL. I have never done anything like this before and thought I'd start gently by attempting to filter for all stocks that have made a new 52 week high for week ending 9 May 2014. I wrote the following in the formula editor (referencing Mr Bandy's example5.afl and modifying to my requirement) :

Liquidity = MA ( C * V, 21 );
New52High = High == HHV ( C, 52 );

Filter = Liquidity >= 100000;
AddColumn ( New52High, "52 High", 1.0 );

I ran an Explore on this - Apply To *All symbols with - Range 1 recent bar(s).
The results gave me stocks which did not reach new 52 week highs as of week ending 9 May. I am honestly clueless. I had set my chart to Weekly for this formula. I had also attempted various iterations by choosing 260 and setting the charts to Daily; removing the liquidity requirement.

I have already searched the Amibroker support site but cannot begin to understand the AFL language that is spoken :( Would appreciate any help or suggestions on where I can get more help in plain english. :banghead:

THanks in advance.
hi
I’m in the same boat, coding will take years to really grasp.
It’s hard to find simple codes to play around with
Have you found any good codes
 
I would be greatful to help me with the code of VWAP Weekly/Monthly/Yearly in AFL, It would also like to Exploration it using Auto Analysis AmiBroker function.

My Contact -aryan.advisory @ g m a i l . c o m

Thank and Regards
 

Attachments

  • vwap-weekly-monthly-yearly.png
    vwap-weekly-monthly-yearly.png
    45.9 KB · Views: 23
For the visitor in New Delhi. Using the S&C Traders' Tips formula @ http://www.amibroker.com/members/traders/04-2017.html

Code:
//////// VWMA \\\\\\\\

TimeFrameSet(inDaily);
VrangeDaily = Param("VWMA Daily", 50, 1, 200);
Vsum = Sum(V, VrangeDaily);
Vpsum = Sum(C * V, VrangeDaily);
VwmaD = Vpsum / Vsum;
TimeFrameRestore();

TimeFrameSet(inWeekly);
VrangeWeekly = Param("VWMA Weekly", 50, 1, 200);
Vsum = Sum(V, VrangeWeekly);
Vpsum = Sum(C * V, VrangeWeekly);
VwmaW = Vpsum / Vsum;
TimeFrameRestore();

TimeFrameSet(inMonthly);
VrangeMonthly = Param("VWMA Monthly", 50, 1, 200);
Vsum = Sum(V, VrangeMonthly);
Vpsum = Sum(C * V, VrangeMonthly);
VwmaM = Vpsum / Vsum;
TimeFrameRestore();


Plot(TimeFrameExpand(VwmaD, inDaily), "Daily VMWA", colorRed);
Plot(TimeFrameExpand(VwmaW, inWeekly), "Weekly VMWA", colorBlue);
Plot(TimeFrameExpand(VwmaM, inMonthly), "Monthly VMWA", colorYellow);

Plot(C,"", colorBlack, styleBar);

Untitled.png
 
Can I set a weekly periodicity through an AFL code.
I found this post when I was searching for the same solution, so thought I'd reply for others to benefit.

No, you can't code Periodicity in AFL - but you can put some code in to check if periodicity is set correctly for your strategy and display an error if it isn't. It helps when running backtests and spending too much time reviewing results on the wrong periodicity.:(

The code is below, just pop it in your AFL and change the "inDaily" to "inWeekly" or whatever you're trying to enforce.

Code:
// Switch (Automatic Analysis Periodicity Checker)
periodicityCheck = True;

if (periodicityCheck)
{
    if (Status("action") == actionScan OR Status("action") == actionExplore OR Status("action") == actionBacktest)
    {
        if (NOT Interval() == inDaily) Error("Automatic Analysis 'Periodicity' - Must be set to 'DAILY'!");
    }
}

Screen shot of error returned.
upload_2020-8-24_12-3-28.png
 
Top