Hindenburg Omen

Hi,

I am wondering if anyone has been able to script for a show bar the Hindenburg Omen for the DJI, S&P 500 and the XJO?

The Hindenburg Omen is a technical indicator that was designed to signal the increased probability of a stock market crash. It compares the percentage of new 52-week highs and new 52-week lows to a predetermined reference percentage to predict the increasing likelihood of a market crash. Named after Germany’s Hindenburg airship that crashed on May 6, 1937 it was conceived and promoted by James R. Miekka. It would have been a good show bar to have popped up a few weeks ago and I’m trying to implement it now.

The rules that are required to be scripted are in the attached document.

I have attempted a start but I can’t get the breath indicators to work for those 3 indices. I would be grateful if someone could assist with the scripting as this is beyond my capability. My start of the coding is below but you may wish to start afresh.

Thanks,

Karen


//Source DJI Data

V1 = GETDATA(CODE=DJI:WI)

 

 

//Daily number of 52 week highs

V1 = GETDATA(CODE=DJI:WI)

V2 = BREADTHDATA()

 

 

//Number of all stocks in DJI

 

 

///McClellan Oscillator

//Source Data for NYSE Advance and Declines - need to change for DJI but can’t see equivalent code

D1 = GETDATA(CODE=ADVNYSE:BM);

D2 = GETDATA(CODE=DECNYSE:BM);

//Setup 19EMAs on AD Codes

A1 = MA(D1, BARS=19, STYLE=Exponential);

A2 = MA(D2, BARS=19, STYLE=Exponential);

//Setup 39EMAs on AD Codes

A3 = MA(D1, BARS=39, STYLE=Exponential);

A4 = MA(D2, BARS=39, STYLE=Exponential);

 

(A1 - A2) - (A3 - A4)

 

 

///McClellan Oscillator is negative

 

 

///52 week highs are not more than 2 times 52 week lows

 

 

 

 

Historical 52 week Hi Lo data from Optuma is not back adjusted (reconstituted for index changes) so be careful. That said, using DTN you have some other options using symbols FINH.Z and FINL.Z. I hope this helps eliminate a little confusion as it took me a while to figure out the data discrepancy and just solved the issue I was having this morning (I too was looking to script this so I’ll be following along).

Hi,

For future reference this post would have been better suited for the Scripting section of the forum.

Attached is a workbook that contains the elements of each of the 4 rules, split up so you can see how they work individually. The version is for the NYSE.

You should be able to use the individual Show Views to build a combined single script if you need it, however the individual scripts can be used with items like Back Testing and Scanning as long as the Operator between them are set to AND:

Ex4

The workbook contains 2 tabs, one where each script is split into its own Show View indicator:

And another where the scripts are merged into a single tool (Analysis Cluster) which will show a value of 4 along the top when all 4 criteria are met.

Note: For this workbook to open on your system you will need the World Indices and Breadth data exchanges enabled on your account.

Hin.owb (27.9 KB)

Thanks.