This is a mobile optimized page that loads fast, if you want to load the real page, click this text.
No, but i'll check it out thanks GB.


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.
 
Hi
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
    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);

 
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.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more...