Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

MilesT

Members
  • Content Count

    1
  • Joined

  • Last visited

Personal Information

  • First Name
    Miles
  • Last Name
    Treschan
  • Country
    United States

Trading Information

  • Vendor
    No
  1. Thanks ValueTrader for posting this code. Can you show me how to modify it to start at a particular time, say 1800? Thanks in advance, MilesT Code: vars: vwap(0), pv(0), Totalvolume(0), Barfromstart(0), Squareddeviations(0), Probabilityweighteddeviations(0), deviationsum(0), standarddeviation(0); If date > date[1] then begin Barfromstart=0; pv=AvgPrice*volume; Totalvolume=volume; vwap=pv/totalvolume; end else begin Barfromstart=Barfromstart[1]+1; pv=pv[1] + AvgPrice*Volume; Totalvolume=Totalvolume[1] + Volume; vwap=pv/Totalvolume; end; deviationsum=0; for value1= 0 to Barfromstart begin Squareddeviations=Square( vwap-avgprice[value1]); Probabilityweighteddeviations=volume[value1]*Squareddeviations/Totalvolume; deviationsum=deviationsum +Probabilityweighteddeviations; end; standarddeviation=SquareRoot(deviationsum); Plot1(vwap); Plot2(vwap+standarddeviation); Plot3(vwap+2*standarddeviation); Plot4(vwap-standarddeviation); Plot5(vwap-2*standarddeviation);
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.