How to Create an Indicator (using Ninjatrader)

Post on: 16 Март, 2015 No Comment

How to Create an Indicator (using Ninjatrader)

by Mark Williams on May 4, 2009

Okay, so here is the scenario.

You have just read a paper by some famous mathematician. In the paper, he talks about using a formula to calculate some thingamabobjiggy, and you, for some strange reason, have an epiphany, and decide to see if what was written in the paper would work for trading.

So, you put on you thinking cap, and decide to go about creating this wonderful formula, and try to see if it can help you gain an edge in the market.

So, how do you go about creating this fancy, schmancy indicator?

Well, like your strategy from lessons before, you need to flesh out your idea.

Using mind maps helps, but in the case of making THIS indicator, we already have the math available, so need to really think about what we are creating.

So, we skip to the next stage, which is flowcharting/paragraphing our idea. In todays example, we are going to do the paragraphing method.

So, what are we creating?

Well, we are going to create an indicator called CANDLE BODY MOMENTUM.

Whered I get this thing? Well, I found some information about it in Perry Kaufmauns book New Trading Systems Methods.

Now, before you rush out to get this thing, I have to warn you: the book weighs like 10 pounds, and you could literally kill someone with it.

It is jammed full of technical information on almost every indicator that is currently out there, and I DO RECOMMEND that you check it out, but I had to warn you

What I used this book for is to look at what indicators to avoid, but that will be another lesson for another day.

What is CANDLE BODY MOMENTUM?

Well, it is the comparison of up candles (when the closing price of a period is higher than the open price), versus that of down candles (where the closing price of a period is less than that of the open).

Here is the equation we are working from:

CandleBodyMomentum = Number of Up Days/ (Number of Up Days + Number of Down Days)

The period that he starts off with was 14.

So, out of 14 past bars of data, we take the number of UP days (Close > Open) during that 14 day period, and number of DOWN days (defined as Close < Open)

Once I have the number of UP days, I divide by the period (since UP days + DOWN days = Period) to get the momentum.

How to Create an Indicator (using Ninjatrader)

So, as Candle Body Momentum goes up, expect positive price action.

As Body Momentum goes down, expect negative price action.

Once the number is released and charted, we update to the next bar, and repeat

Now that we have this information created, we will create the code.

At this point, if you are not a programmer, then you could turn this project over to you handy dandy programmer from Elance, Rent-A-Coder, or your cousin with too much time.

If you are a programmer, then you should be able to handle this yourself

And, if you can not afford a programmer, then it is time to grab a book, or you charting softwares manual.

One of the many things that I have learned on my journey is that if you have no time to learn something, then you had better have money

If you have no money, then you had better have or make time!

In part two, we will go over how to take the above from its current form, to code.

Continued on in Part II


Categories
Tags
Here your chance to leave a comment!