Using Zig() to reveal profit potential

Indicators like the Zig() can be used to reveal the profit potential for different stocks and in different time frames. Using this function is purely a fun experiment to give you a sense of where the profits are and what happens when you reduce trade duration. This function looks into the future and, of course, should never be used for trading with real money.

As shown below in the last line of the code, the Chart Title displays profit potential for combinations of trade duration and % change. Author’s note: while this is arguable, my interpretation is that shorter trade durations will give you smaller DDs, lower risk, and greater profits. The old argument of commission costs killing a High Frequency trading system no longer holds; commission costs may almost be ignored. For managing a high number of short term trades, using the IBc can allow 100 or more automated trades per day with no effort at all.

To run this code, copy it to an Indicator, click Insert, right-click on the chart to bring up the Param window, and vary the parameters to see for yourself where the profits occur. Try changing the ticker, commissions, the test period, etc. You may be surprised and decide you are trading the wrong Tickers.

Opt1 = Param("%Zig(Change)",0.1,0,1,0.05);
Opt2 = Param("Min.AllowableDuration",1,1,20,1);
Z = Zig(C,Opt1);
Buy = Z < Ref(Z,1) AND Z < Ref(Z,-1);
Sell = Z > Ref(Z,1) AND Z > Ref(Z,-1);
Buy = Buy AND BarsSince(Sell) > Opt2;
Sell = Sell AND BarsSince(Buy) > Opt2;
Short = Sell;
Cover = Buy;
Eq = Equity(1);
ShowTriangles = ParamToggle("Arrows","HIDE|SHOW",1);
InitialEquity = GetOption("InitialEquity");
Title = "\n"+"\n"+"FinalProfit:"+NumToStr((LastValue(Eq)-InitialEquity)/InitialEquity*100,1.2)+"%\n";

Edited by Al Venosa

1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 4.80 out of 5)

One Response to “Using Zig() to reveal profit potential”

  1. Kar
    October 8th, 2007 | 1:21 pm

    Hi Al,

    Very neat piece of work. This has great significance in day trading, particularly when combined with Fib clusters.

    Best Wishes,