Thanks
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Line Properties
Collapse
X
-
Line Properties
The indicator I’m coding uses bars to calculate on a 45 min chart, but my trading chart is 1000 tick. If my code draws a horizontal line on the 45 min chart, the properties window of the line does not give me the option to print on All Charts, options in the little window are greyed out. I need to show this line on my trading chart. Is there any way to fix this?
ThanksTags: None
-
Hello,
This would be possible through using the StreamWriter and StreamReader. The concept here would be you would get the value in indicator 1 and write the value to a file using StreamWriter and then in Indicator 2 read the value using StreamReader. Please see the following refence sample on StreamWriter: http://ninjatrader.com/support/forum...ead.php?t=3475
Please see the following reference sample on using StreamReader: http://ninjatrader.com/support/forum...ead.php?t=3476Cody B.NinjaTrader Customer Service
Comment
-
Hello Pete and atata,
NinjaTrader_CodyB is correct here in that sharing information between indicators can be achieved by writing to and reading from a file.
Indicators and strategies have a separation. An instance of an indicator cannot communicate with another running instance of an indicator directly.
However, an undocumented way of passing information between scripts in NinjaTrader 7 is to use a static variable or class in a custom namespace or within the Indicator namespace or Strategy namespace.
This was not supported or documented with NinjaTrader 7 because using this will prevent a script from exporting. Also, any static variables cannot be optimized over in the Strategy Analyzer.
Some information can be found about this in the threads below.
https://ninjatrader.com/support/foru...ad.php?t=72638
http://ninjatrader.com/support/forum...ad.php?t=10503
http://ninjatrader.com/support/forum/showthread.php?t=4230ZChelsea B.NinjaTrader Customer Service
Comment
-
Hello atata,
The .lsGlobal property of a drawing object that when true lets you know if this object will appear on all charts with the same instrument.
In NinjaTrader 7, it is not possible to draw an object as a global object, however, this is possible with NinjaTrader 8 when drawing a new drawing object.
After the object is drawn in NinjaTrader 8, it is no longer possible to set the object to global.
To understand how a global drawing object works, try opening two charts with the same instrument. Then manually draw a dot or another object on one of the charts. Next, right-click the drawing object and select Properties... In the properties set the 'Apply to' to 'All Charts' in NT7, or in NT8 set 'Attach to' to 'All charts', then click OK.Chelsea B.NinjaTrader Customer Service
Comment
-
-
To continue I know now what I have been trying to do (one chart getting a value from another) is not possible. Scott Daggett, author of NinjaScript Programmers Launch Pad was kind enough to point out that my problem can be solved by the fact that ninjaScript supports multi-time frame and instruments in a single script.
So I am off to see if I can learn how to do that.
Comment
-
Hello Pete77,
I am not aware of a way to make an indicator itself static.
However, using undocumented methods you could create a static class or variable within the scope of the NinjaTrader.Indicator namespace.
Also, to add a secondary series to your script use the Add() method.
Below is a link to the help guide on the Add() method.
http://www.ninjatrader.com/support/h...s/nt7/add3.htm
A link to the help guide on BarsInProgress.
http://www.ninjatrader.com/support/h...inprogress.htm
And a link to the help guide on Multi-Time Frame & Instruments. Please see the section 'How Bar Data is Referenced', and 'Accessing the Price Data in a Multi-Bars NinjaScript'.
http://www.ninjatrader.com/support/h...nstruments.htmChelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by andrewtrades, Today, 04:57 PM
|
0 responses
3 views
0 likes
|
Last Post
by andrewtrades
Today, 04:57 PM
|
||
Started by chbruno, Today, 04:10 PM
|
0 responses
3 views
0 likes
|
Last Post
by chbruno
Today, 04:10 PM
|
||
Started by josh18955, 03-25-2023, 11:16 AM
|
6 responses
436 views
0 likes
|
Last Post
by Delerium
Today, 03:42 PM
|
||
Started by FAQtrader, Today, 03:35 PM
|
0 responses
6 views
0 likes
|
Last Post
by FAQtrader
Today, 03:35 PM
|
||
Started by rocketman7, Today, 09:41 AM
|
5 responses
19 views
0 likes
|
Last Post Today, 03:33 PM |
Comment