https://ninjatrader.com/support/foru...etch?id=848328
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Divergent Bar
Collapse
X
-
Divergent Bar
Does anyone know how to convert this to nt8?
https://ninjatrader.com/support/foru...etch?id=848328Tags: None
-
Hello dstewart12,
Thanks for your post and welcome to the NinjaTrader forums!
There are a few key items to look for when converting your scripts from NinjaTrader 7 format to NinjaTrader 8, and we keep a Code Breaking Changes table updated in the NinjaTrader 8 Help Guide to assist in identifying changes or new implementations of familiar methods and properties from NinjaTrader 7: https://ninjatrader.com/support/help...ng_changes.htm
Some notable items to consider when converting your code will be the following:- Initialization has changed significantly. Initialize() has been replaced with OnStateChange(), which can be used to filter out different stages of the entire life cycle of a script (SetDefaults, Configure, Historical, Realtime, Terminated, etc.) OnStateChange() is fully covered in the Help Guide.
- The names of many methods and properties have changed slightly, so you will need to refactor these in your code. The Code Breaking Changes table can make this task much easier, and there is also an alphabetical reference in the Help Guide that can help to find new method/property names: https://ninjatrader.com/support/help..._reference.htm
- In numerous instances, you now have direct access to objects, where in NinjaTrader 7 you had to work with interfaces. For example, rather than the IOrder interface, you now have direct access to an Order object and its related fields. This will require a change in the way items like this are handled in your code.
You could create a new indicator in NinjaTrader8 with the Ninjascript indicator wizard which will create the basic structure (including plots): https://ninjatrader.com/support/help...?ns_wizard.htm Once created you could then copy over the code inside the OnBarUpdate() method of NT7 and pasted into the same OnBarUpdate() method in NT8. Then all that would be needed would be to replace .Set with [0] =, for example, change DivBarUp.Set(High[0]+TickSize); to DivBarUp[0] =(High[0]+TickSize);
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
577 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment