2009/12/04

Fast VWAP for AmiBroker

This is fast enough to use on a 5-second chart. No-loop calculation of VWAP and standard deviation, from Head2K at traderslaboratory:

ND = Day() != Ref(Day(), -1);

P = (H + L) / 2;
VWP = P * V;
BI = BarIndex();

BeginBI = ValueWhen(ND, BI);
BeginBI = BeginBI[BarCount -1];

if ( BeginBI < BarCount -1 )
{
Inrange = BI >= BeginBI;
CumV = Cum(V * InRange);
CumVWP = Cum(VWP * InRange);
VWAP = CumVWP / CumV;
S = Cum(Ref(CumV, -1) * V * (P - Ref(VWAP, -1))^2 / CumV);
Variance = S / CumV;
SD = sqrt(Variance);
VWAP = IIf(InRange, VWAP, Null);

Plot(VWAP, "VWAP", colorYellow, styleNoTitle );
Plot(VWAP + SD, "+1SD", colorGreen, styleDashed + styleNoTitle );
Plot(VWAP - SD, "-1SD", colorRed, styleDashed + styleNoTitle );
Plot(VWAP + 2*SD, "+2SD", colorSeaGreen, styleDashed + styleNoTitle );
Plot(VWAP - 2*SD, "-2SD", colorOrange, styleDashed + styleNoTitle );
}

Plot(Close, "C", colorGrey40, styleLine);

2009/12/02

Trading System Development


2009/02/13

Windows XP USB device installation problems

  • Error messages and symptoms
    • Found New Hardware Wizard
      • "Cannot install this hardware"
      • "Wizard cannot find the necessary software"
    • Yellow exclamation icon next to devices in Device Manager
    • Driver not found
  • General troubleshooting
  • Possible cause/solution (in order of increasing desperation)
    • INF files corrupt or missing from c:\windows\inf
      • Copy from another XP machine
        • usb.inf
        • usbport.inf
        • usbprint.inf
        • usbstor.inf
        • usbvideo.inf
    • INF cache corrupted
      • Delete c:\windows\inf\infcache.1
      • Scan for new hardware in device manager
      • Windows will re-create the INF cache
    • USB hub powered off
    • Corrupt Config value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network
    • Export/Import device registry settings

2009/02/06

Multi-Monitor Trading Workstation

2009/01/12

General Trading Books

  • General
    • "High Probability Trading", Marcel Link
    • "Trading for a Living", Alexander Elder
  • Psychology
    • "The Disciplined Trader", Mark Douglas
    • "Trading in the Zone", Mark Douglas
    • "Fooled by Randomness", Nassim Taleb
  • Markets
    • "Reminiscences of a Stock Operator", Edwin Lefevre
    • "Market Wizards", Jack Schwager (1992)
    • "New Market Wizards", Jack Schwager (2008)
    • "The Stock Trader: How I Make a Living Trading Stocks", Tony Oz (2000)
  • Trading Systems
    • "Way of the Turtle", Curtis Faith (2007)

2009/01/10