Wednesday, November 6, 2013

Window, The Definitive Calculation

In case there remain questions about the "exact" definition of a "window," take a look at the following pseudo-EasyLanguage* algorithm to calculate Window:

// Calculate 50 period simple moving average 
// based on candle close
50MA = Average(Close, 50);

// if the entirety of the candle is 
// above the moving average
if ( (High > 50MA) AND (Low > 50MA) ) then
  Window = Absolute( Low - 50MA );
else
   // if the entirety of the candle is 
   // below the moving average
   if (  ( High < 50MA ) AND (Low < 50MA) ) then
     Window = Absolute( High - 50MA );
   else Window = 0;  // Candle straddles MA, no window

// Display the window size
Plot1( Window, "Window" );

Over time, you will develop a feeling for the proper window size. When you see these windows, you can then draw the swings on your chart. These swings serve as the basis to measure Fibonacci retracements and extensions.

The following list gives you an idea of the window size that I use, by product, by trading time frame:
  • YM 233 tick: 3.9 point window
  • YM 144 or 89 tick: 2.1 point window
  • ES 987 tick: 1 point (4 ticks) window
  • CL 233 tick: 0.06 (6 cents) window
This list is merely a starting point. To be a successful trader, you must find what works for you.


* EasyLanguage is the Tradestation programming language - I am not affiliated with Tradestation, but I do use their platform 

No comments:

Post a Comment