NexusFi: Find Your Edge


Home Menu

 





Gann HiLo Indicator


Discussion in TradeStation

Updated
    1. trending_up 8,815 views
    2. thumb_up 6 thanks given
    3. group 3 followers
    1. forum 2 posts
    2. attach_file 2 attachments




 
Search this Thread

Gann HiLo Indicator

  #1 (permalink)
 
cbritton's Avatar
 cbritton 
Atlanta, Georgia
 
Experience: Intermediate
Platform: NT
Broker: DDT
Trading: ZN, ZB
Posts: 230 since Mar 2010
Thanks Given: 152
Thanks Received: 256

I have been considering using the Gann HiLo indicator as a trailing stop and since I'm an active TS user, I decided to convert my ToS version to EL. Here's the indicator:

 
Code
inputs: length(12),
        averageType(2);
vars: swing (0);

switch (AverageType) begin
case 1: // SMA
    value1 = Average(high, length);
    value2 = Average(low, length);
case 2: // EMA
    value1 = XAverage(high,length);
    value2 = XAverage(low,length);
case 3: // DEMA
    value1 = _DEMA(high,length);
    value2 = _DEMA(low,length);
//case 4: // HULL
    //value1 = _HMA(high,length);
    //value2 = _HMA(low,length);
case 5: // WMA
    value1 = WAverage(high, length);
    value2 = WAverage(low, length);
default: // default to EMA
    value1 = XAverage(high,length);
    value2 = XAverage(low,length);
end;

if CurrentBar > length then begin

    if close < value2[1] and close[1] >= value2[2] then 
        swing = -1
    else if close > value1[1] and close[1] <= value1[2] then 
        swing = 1 
    else swing = swing[1];
end;

if swing = -1 then value3 = value1 else if swing = 1 then value3 = value2 else if swing[1] = -1 then value3 = value1 else if swing[1] = 1 then value3 = value2;

Plot1( value1, "Rising" );
Plot2( value1, "Falling" );

value4 = iff(swing=-1, GetPlotColor(1), GetPlotColor(2));

Plot3( value3, "EMA", value4);

NoPlot(1);
NoPlot(2);
The second input value, averageType, is a numerical value corresponding to the type of moving average to suite your needs. 1 = SMA, 2 = EMA, 3 = DEMA, 4 = Hull, and 5 = weighted MA. The default value, if the averageType value is not in this range is EMA.

I commented out the hull moving average function reference because my version has a copyright mark. I think I got it off the TS support site if you want/need it. I'm sure it's available on google. The DEMA is not, so here's that function if you don't have it:

 
Code
inputs:
    Price(NumericSeries),
    Length(NumericSimple);

variables: 
    float emaPrice(0),
    float emaEmaPrice(0);                    

emaPrice = _xAverage(price, length);
emaEmaPrice = _xAverage(emaPrice, length);

_DEMA = 2 * emaPrice - emaEmaPrice;
Regards,
-C

“Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” - Sun Tzu
Attached Thumbnails
Click image for larger version

Name:	gann_hilo_slv.PNG
Views:	781
Size:	37.7 KB
ID:	38996  
Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
Exit Strategy
NinjaTrader
How to apply profiles
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
33 thanks
Just another trading journal: PA, Wyckoff & Trends
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #2 (permalink)
uninhausen
barcelona
 
Posts: 1 since Jun 2012
Thanks Given: 0
Thanks Received: 0

Hi there,

would you mind to share the Schaff cycle indicator for ToS? thanks in advance.

Reply With Quote
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


I would just like to make a small comment here on the Gann Hi-Lo Activator:

The Gann Hi-Low Activator has two stop lines which are calculated from a moving average of the Highs and a moving average from the Lows of the last N bars.

Now what you also could do is to calculate

- the same moving average from the last N bars from the center = (high + low)/2
- calculate the same moving averate of the range of the last N bars

and then take the values

- high stop = average of center + 0.5 * average range
- low stop = average of center - 0.5 * average range

This is nothing else than a Supertrend that

- uses the same average of period N as the Gann-HiLo-Activator,
- then applies that average to the last ranges of the last N bars
- and adds and subtracts half an average range

The SuperTrend has the advantage that you can modulate the factor 0.5, which is fixed for the Gann-HiLo-Activator. Usually you will set your stop line farther away from pirce action to avoid to get stopped out quite often.

Nobody who has a SuperTrend needs a Gann-HiLo-Activator. Scrap it!

Chart attached below.


Reply With Quote
Thanked by:




Last Updated on July 30, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts