Swing Hi Lo for Excel

Discussion in 'Programming' started by maninjapan, Jan 26, 2012.

  1. I am currently doing some data analysis is Excel, barely literate in VBA. I was wondering if anyone knew of a way to calculate Swing Hi Lo in excel? I am in the process of searching for something on the web but not having much luck and just wondering if anyone had anything or knew of anything that would point me in the right direction.

  2. FuturePrice

    FuturePrice ET Sponsor

  3. Thanks for the reply, looks like this just calculates profits from trades. Not quite what I am looking for unfortunately. I am looking to replicate the Basic Swing High/Low indicator in excel. Not related to any trades.
  4. Single or dual parameter ?
    With a single, you can only have a symmetrical swing pattern....basically go back "n" bars and check the prior n bars to make sure they are all higher than the nth bar.
  5. sys, thanks for the reply. By single or double, do you mean different settings for high and low? I am looking to use the same number of bars to check for a high or low.
  6. No, you don't understand. The computation for the swing high and swing low should be equivalent.
    Double parm means: the computation for the prior periods is a different length than the current period.
    So the lookback and lookforward lengths are different with 2 parms.
    Ex: 10,20
    For swing low: go back 20 bars, check the prior 10 bars to make sure they are sequentially lower, the check the next 20 bars to insure they are sequentially higher. Now you have a 10,20 swing low signal.
  7. sys, thanks for the explanation. You are right. I didnt understand. I'm only familiar with a single then. So whatever number I use I look forward and back that number of bars. For A swing high The surrounding bars dont have to be sequentially lower though right? As long as the bar is just the highest of the look back period, right?
  8. My bad....that is correct. Just compare the tested bar to insure all backward bars are higher and forward bars all lower (swing low)...reverse for swing high.
    Another metric in this analysis is strength.....how far up or down it has moved since the tested bar.