![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Dec 2009
Posts: 135
Thanks: 2
Thanked 1 time in 1 post
|
Hello
I want to plot MAX(High,CalcDistanceL)[1] on the chart, but I get an error. This works: Add(MAX(High,CalcDistanceL)) This does not work Add(MAX(High,CalcDistanceL)[1]) Error: 1-Argument: cannot converted from "double" in "NinjaTrader.Indicator.IndicatorBase" and The best match for the overloaded NinjaTrader.Strategy.StrategyBase.Add(NinjaTrader. Indicator.IndicatorBase)-Methode has several invalid arguments How can I plot the MAX as above? thanks |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Beauregard, you can only add complete indicators for plotting / visualization by your strategy - so in order to plot the max, create an indicator that would return this plot and then add it.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2009
Posts: 135
Thanks: 2
Thanked 1 time in 1 post
|
I am not sure, whether I understand correct.
Plotting the Max works, as I have written: Add(MAX(High,CalcDistanceL)) What does not work is MAX until the previous day |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
You access a double value then and not a full series, this would not be possible, as you can only add a full indicator and not visualize a single value / plot.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Dec 2009
Posts: 135
Thanks: 2
Thanked 1 time in 1 post
|
OK, all clear, thanks
|
|
|
|
|
|
#6 | |
|
Senior Member
|
Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why doesn't ADD index work? | relogical | Charting | 5 | 06-21-2012 08:51 AM |
| CurrentBar Value of MAX(High, 20)[0]; | RJay | General Programming | 1 | 07-12-2011 09:58 AM |
| "High[-1] >= High[0]"... does this work in Ninjascript? | fredb987 | Strategy Development | 3 | 10-05-2010 11:59 AM |
| Please Add MAX to optimation setups | ChuckAllen | Version 7 Beta General Questions & Bug Reports | 1 | 06-12-2010 10:54 AM |
| && (MAX(High, 4)[0] <= Swing ().SwingHigh[0]) | duck_CA | Strategy Development | 11 | 03-17-2009 11:35 PM |