NexusFi: Find Your Edge


Home Menu

 





Code to programatically save and load indicator properties (templates) in NT8


Discussion in NinjaTrader

Updated
    1. trending_up 1,288 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 b16aln 
London
 
Experience: None
Platform: ninjatrader
Trading: ftse100
Posts: 67 since Sep 2017
Thanks Given: 11
Thanks Received: 23

Hello,

As the title suggests I am looking for some code that I can use in my indicator to save and load the indicator properties to external xml files. As is generally my experience with nt8 support, they were unhelpful and refused to share the code to do this (https://forum.ninjatrader.com/forum/ninjatrader-8/indicator-development/1218493-code-to-save-and-load-indicator-templates)...so I am reaching out for some guidance here as I have no experience of xml and how to get it into the nt8 format. Loading and saving templates seems like such a common requirement that there must be many users that have already worked out and implemented this so hoping someone can share the code before I have to go balls deep into researching/implementing it.

I searched high and low and found this thread relating to nt7: . I don;t really understand what is going on with this example or how to translate it to nt8 but it seems to be generally what I am looking for.

If anyone can help it would be much appreciated.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Khamenei Vetoes Uranium Transfer as Peace Odds Surge to …
Prediction Markets & Event Contracts
The Backwardation Signal: How the CL Futures Curve Tells …
Commodities
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
Five Days Until the Gap Dies -- CME Goes 24/7 on All Dig …
Traders Hideout
MegaETH Proves the Crowd Right: Prediction Markets Calle …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 thanks
  #2 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
Legendary Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,580 since Oct 2009
Thanks Given: 4,266
Thanks Received: 6,199


b16aln View Post
Hello,

As the title suggests I am looking for some code that I can use in my indicator to save and load the indicator properties to external xml files. As is generally my experience with nt8 support, they were unhelpful and refused to share the code to do this (https://forum.ninjatrader.com/forum/ninjatrader-8/indicator-development/1218493-code-to-save-and-load-indicator-templates)...so I am reaching out for some guidance here as I have no experience of xml and how to get it into the nt8 format. Loading and saving templates seems like such a common requirement that there must be many users that have already worked out and implemented this so hoping someone can share the code before I have to go balls deep into researching/implementing it.

I searched high and low and found this thread relating to nt7: . I don;t really understand what is going on with this example or how to translate it to nt8 but it seems to be generally what I am looking for.

If anyone can help it would be much appreciated.

I have created a routine to read an XML file in my strategy. I used it to read the current ATM template selected in the Chart Trader.

Here is an example i have done for you (took it from my strategy).
https://pastecode.io/s/23zsmphb

Don't forget to add these lines at the top of your script:
using System.Xml.Serialization;
using System.Xml;


Reply With Quote
Thanked by:
  #3 (permalink)
 b16aln 
London
 
Experience: None
Platform: ninjatrader
Trading: ftse100
Posts: 67 since Sep 2017
Thanks Given: 11
Thanks Received: 23


Thank you my friend! That's excellent and very good of you to help me out. I'll go over it properly on Monday and try to implement it next week. Thanks agin


Started this thread Reply With Quote
Thanked by:




Last Updated on October 8, 2022


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts