What is the best way to visually backtest an indicator? Is there some marking arrow function which will stamp the price on the chart? I know it's rather rudimentary but I have no programming skills to work with so this is the best I can do for now.
This post has been selected as an answer to the original posters question
Not sure how much of an explanation you wanted, but here is a very BASIC way to accomplish what you want and is a very simple example.
If you wanted to do this, you would need to create an arrow via NT script to plot based on some conditions you want to test. For example if you wanted to test a MACD crossing above 0, you would write a script with the following lines of code:
That is just the entry. Say you wanted to exit when the MACD crosses back below 0. I like to plot a different chart marker for my exits so I use an opposing direction triangle. You would add this line of code:
You could also print the closing price of the bar with the arrow there by appending the first statement above with this "DrawText" line to print the price so it will be easier to see:
You also want to set a flag so that your script knows weather or not a trade has been triggered.... but for the purposes of this example, since we are just using the 0 crossing of an oscillator, it knows long if above zero, and flat if below.
Attached is what that looks like on a chart.
Last edited by forrestang; September 23rd, 2011 at 06:42 AM.
Basically why I ask is that I want to create a visual backtest using the following indicators when they are in trend mode. The reason I ask just for a visual backtest is that I am not sure if the past two days are extremely trendy or if I found some really sweet combination of entries and exits.
Yes, it seems my original idea is much more about an indicator than a "backtest." Apologies for being so vague.
As you can see from the screenshot, if the heiken ashi bar is red, the adx indicator is blue and the ema slope bars are red, that would be a good time to short.
For long the Heiken Ashi would be Yellow, the Adx blue and the EMA Slope Green.
I actually tried to do this in strategy mode using the bool command (these are all true false conditions) but I got stopped at the beginning when it asked for the input series and I didn't know how to tell it what to do.
Anyways, I feel like I should pay someone to do this or at least find someone to pay to teach me, this seems like awfully tedious work for someone who actually knows how to program on ninjatrader.
I have gone ahead and pm'd you the indicators as one of them cannot be found on the elite section but I am almost certain I found it there.
I think the big deal about this combination is that it has 2 indicators which deal with nothing but avoiding chop. Not that they avoid it but they seem to put the odds in your favor when you trade high volume times of day (or night in my case).
Also keep in mind that the signal for the bar must be in alignment with the trend. So if it's a buy signal the close of the signal bar should be bullish (a close higher than it opens) and reversed for a bearish signal. The OHLC bars are extremely useful for alerting us to this.
Although I am completely new to NinjaTrader I have been with Metatrader for more than 5 years so I have a pretty good idea about trading Forex. I am really tired of bad brokers though so I am trying to transition to a more open market, namely futures markets.
Last edited by peglegtrading; September 23rd, 2011 at 08:52 AM.