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.

TMc1908

Members
  • Content Count

    2
  • Joined

  • Last visited

Personal Information

  • First Name
    Terry
  • Last Name
    McGivern
  • Country
    United Kingdom

Trading Information

  • Vendor
    No
  1. Thanks Roberto, contacted them and they've been helpful...however, was wondering if anyone could cast their eye over the code and just confirm that there are no glaring errors. It seems to be correct to me, just slightly puzzled as to how it is actually acting on my chart though as it seems to be fanning out i.e. they appear to expand and contract similar to a bollinger band (but not as obviously) which I never expected to be honest On CQG there are curves for each of the 7 lines, but code all the same on each bar last line has different DevMultiplier option and either add or subtract. The below is code for 1st Deviation line: Vol1:=IF( HasVal(Vol(@)) AND Vol(@) > 0, Vol(@), 0) ; priceX:= IF(price = 1, Close(@), IF(price = 2, High(@), IF(price = 3, Low(@), IF(price = 4, Mid(@), IF(price = 5, HLC3(@), IF(price = 6, Avg(@), IF(price=7, Open(@), 0) ) ) ) ) ) ) ; Bars1:=IF((BarsSince(HasVal(@)=0,1,10000) WHEN BarIx(@,StartOfDay)=0)> 0, BarIx(@,StartOfDay)+1, BarsSince(HasVal(@)=0,1,10000)) ; VWAP1:= Sum(priceX* Vol1,Bars1)/ Sum( Vol1,Bars1); Variance1:= Sum( (Vol1/ Sum( Vol1,Bars1))* Power((priceX-VWAP1),2.00000),Bars1); StdDev1:= SqRoot( Variance1); VWAP1+(StdDev1*DevMultiplier1) DevMultiplier1 is an on chart option where you can specify what multiplier to use ON CQG there are curves for each of the 7 lines, code all the same, just different DevMultiplier option and either add or subtract. The below is just for the 1st Deviation line as an example
  2. Hi Guys, I have read right through the "Trading with Mkt statistics" thread, all parts....what i still can't seem to fathom is the definitive formulas to use for the std dev. As everyone codes in different programs, could we not just have it stated explicitly by Jerry (or someone who has the exact same algorithm for coding it as him) but in layman terms without ANY specific program related syntax e.g. for vwap it would be: VWAP = [(SUM(PiVi))/Vtotal] where Pi = Price of each bar in distribution (Either; (O+H+L+C/4) or use the closing price of bar) Vi = Volume of each bar in distribution Vtotal = Total Volume for whole distribution At the moment, there seem to be so many conflicting ideas and formulas for the Std Deviation parts that I don't know which to use when coding that part of the process. I'm doing it in CQG which brings it's own issues of using different syntax than what some of you guys use, so if it could be spelled out completely in english as above has been for VWAP it would be appreciated. That way, it should be easier to just code it in whatever platform each person uses. Thanks TMc1908
×
×
  • Create New...

Important Information

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