Moving to AmiBroker from NinjaTrader -- Please Advise!!

w.trader

Newbie
Messages
4
Likes
0
I have been using NinjaTrader for many years and am evaluating whether to switch to AmiBroker. To make the switch viable, I will have to reprogram some indicators in AmiBroker.

Rather than spend weeks getting used to AmiBroker's programming language, I hope someone will be able to answer a coding quesiton directly.

For the sake of simplicity let's say that I wanted to create an indicator that would draw a line between the High values on a given chart. In NinjaTrader, the following code is used.

DrawLine(CurrentBar.ToString()+”Line”, false, 1, High[1], 0, High[0], Color.Blue, DashStyle.Solid, 3);

This draws a line from the current day's high (High[0]) to the previous day's high (High[1]) and from the previous day's high to the day before's high etc. Please see attached jpg.

The same result can also be achieved by using a plot instead of a drawn line:
Plot.Set(High[0]);

To quickly evaluate AmiBroker I need to know how to achieve the same result (a line or plot connecting the High values) using AFL language.
 

Attachments

  • Highs.jpg
    Highs.jpg
    41.9 KB · Views: 695
Thanks for the links to the more AmiBroker-centric forums.

I am switching to AmiBroker because I need to do extensive backtesting. I would have to manually collect data in NT and then replay it to backtest, or be limited to the prerecorded futures data that is available from NT. I tried manually recording a while back but the feed I had at the time had some issue with repainting the previous day's data for a second at the beginning of each day...with the effect that the indicators I was testing processed that data eventhough it wasn't part of the days action. Even if this problem could be rectified, I would still have to record for days on end to get a large enough test base.

If I understand correctly, AmiBroker has much more robust data replay capacities including replaying imported data...if you disagree with this, or think there is something better out there, by all means please leave a note in this thread.

Many Thanks.
 
Can you execute trades with Amibroker or you don't need that, just backtesting? In that case, it may be a better choice especially if you're planning of doing portfolio backtesting.
 
Yes, I would be using AmiBroker just for backtesting.

From what I have seen of AmiBroker thus far, I still prefer NT, and will likely stick with it for live trading, but its replay features just aren't robust enough.
 
plot(h, "HighLine", colorblue, styleline);

put that after your normal plot statement in the code and it will plot over your bars, you can also make it recede behind your bars.
To get a better idea of codes, check out any of the codes listed side by side in S&C or Active Trader Mag.
Also, read the AB users manual. Lots of examples.
Also, check out all the code in the Amibroker library accessible to customers.

And yes, with some sweat equity (or hire a developer), you can autotrade with AB.

No, you won't regret the switch.

Cheers
 
Top