![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Senior Member
Join Date: Mar 2006
Location: Bellingham, WA , USA
Posts: 331
Thanks: 0
Thanked 11 times in 8 posts
|
I am working on a strategy which will go long if certain conditions are met and an avg line, which changes color depending on its slope, is the right color. To make the "color" available to a strategy I have created a variable which is set to a number depending on the color of the plot. I've embedded along with the plot statement but I don't know how to make it accessible to a strategy. Here's a sample of the code:
Code:
if (Rising(SMA(Period)))
{
// Connects the rising plot segment with the other plots
RisingPlot.Set(1, SMA(Period)[1]);
LColText = 1;
}
or perhaps do that as well as create a dataseries but the things I've tried don't work. If there is a code sample somewhere that outlines this I would be grateful to see it. Thanks DaveN |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,014 times in 995 posts
|
You would need to expose this dataseries in the indicator to access it in the strategy then - http://www.ninjatrader-support2.com/...ead.php?t=4991
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Mar 2006
Location: Bellingham, WA , USA
Posts: 331
Thanks: 0
Thanked 11 times in 8 posts
|
Bertrand,
Thanks for your help and guidance to the sample code. It works though I am still having trouble making the text variable visible outside the indicator so that it can be used in a strategy. Thanks DaveN |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to plot variable from strategy | KrisS | Strategy Development | 1 | 08-03-2009 05:18 AM |
| Accessing indicator variable from a strategy | epcompany | General Programming | 13 | 07-16-2009 08:25 AM |
| Setting an Indicator Variable from a Strategy | spinalwiz | General Programming | 5 | 12-16-2008 11:40 AM |
| Strategy with a variable that is not plotted | ssierra | Strategy Analyzer | 1 | 03-08-2008 07:17 PM |
| Exposing non dataseries variable | tquinn | General Programming | 10 | 05-17-2007 04:12 PM |