PDA

View Full Version : NinjaScript Strategies vs Indicators


whitmark
04-07-2007, 02:46 AM
I am looking for some clarification on when to use strategies vs indicators above and beyond the obvious trading and position management functionality. Take for example Multi-Timeframe and Instrument methods that appearonly to beavailable tostrategies.But what if I wanted to develop an indicator that shows a higher timeframe (compressed series) trend or another instrument close[0]as an indicator overlayed on the current chart? Would I have to implement this "indicator" as a strategy? This would be okay, except other useful features likeChartTrader do not allow concurrent use of strategies.

Are there other important difference between strategies and indicators (beyond the obvious) thatcan be highlighted? For example, can strategies do everything an indicator can do and then some?

Regards,

Whitmark

NinjaTrader_Dierk
04-07-2007, 03:10 AM
The docs provide pretty in depth info on that issue. Please see NinjaScript->Developing Custom Strategies->Multi-Time Frame & Instruments

Some notes:
- yes, you can run an indicators on a higher timeframe (see samples in the docs)
- however, only indicators on the primary series are visualized on chart, since a chart only holds the primary data series of a strategy
- multi series in a strategy mean you just have a different timeframe on the instrument or even different instruments (which different timeframes).

Not sure what other differences to highlight...

whitmark
04-07-2007, 04:59 AM
Thanks Dierk,

When I try to implement as an indicator and add in the Initialize() section:

CompressBarSize = 300;
Add(PeriodType.Tick, CompressBarSize); // BarsInProgress(1)

and then add in the OnBarUpdate() section:

[size=2]if (BarsInProgress == 1)
{
Plot0.Set(Close[0]);
}
[color=black][font=verdana]But when I try to compile I get the following errors:

No overload for method 'Add' takes '2' arguments
The name 'BarsInProgress' does not exist in the current context

Perhaps I need to add an object in the using declarations to get this to workin an indicator vs strategy. Please advise.

Thanks,

Whitmark

whitmark
04-07-2007, 05:05 AM
another data point . . .

http://ninjatrader.mywowbb.com/forum14/1835.html

NinjaTrader_Dierk
04-07-2007, 05:54 AM
You are trying to write an indicator for a multiple series setup. This does not work, since indicators only support one series.

Here is the apporach you need to take:
- implement your indicator. Note: It only can run on one (!) data series
- access your indicator in a multi series startegy as per doc reference below

whitmark
04-07-2007, 09:54 AM
Thanks Dierk,

Itsgood to know that indicators take a single data series and strategies can take multiple data series of differing time-/tick-frames and instruments.But how would I go about enabling the concurrent use of ChartTrader if its implemented as strategy? I suspect there are other discretionary traders that are interested in multiple-timeframe or multiple-instrument "indicators"yet have no intention of system trading anddon't want to give up ChartTrader. Perhaps this should be logged as a enhancement request for a multiple data-series class of indicator or a ChartTrader compatable class of strategy.

The event driven capabilities in Ninja arepretty slick with a lot of potential,perhaps even more than myother trading platform that allows multiple data series indicators through data synchronization to the nearest second or compression of the primary series to a given multiple.I am not crazy about the idea of potentually giving upthe use of theChartTrader feature that got me interested inusing Ninja Charts/Scripts in the first place.

Regards,

Whitmark

NinjaTrader_Ray
04-07-2007, 11:21 AM
Will add enabling chart trader while running a strategy as an enhancement. Give it some time to see what people want in this area.

Ray

Nathamus
08-29-2007, 02:55 PM
Will add enabling chart trader while running a strategy as an enhancement. Give it some time to see what people want in this area.

Ray

This would be usefull, because limit and stop orders are displayed. I sometimes open two charts on the same unterlying and timeframe: one for the strategy and one for the chart trader, to visualize the currently working orders.

I would be happy if you enable chart trader for charts running a strategy.

thx
Nathamus