NexusFi: Find Your Edge


Home Menu

 





Indicators painted on strategy manager charts


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 
shodson's Avatar
 shodson 
OC, California, USA
Quantoholic
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,971 since Jun 2009
Thanks Given: 534
Thanks Received: 3,711

I have a strategy that I am backtesting. When I backtest it, I get a chart with the prices and the entry and exit signals in it, but that's it. If I manually apply a template to the chart to add in the indicators I want to see it works, but once I run another backtest the indicators are gone again. Is there a way that I can have my indicators on the backtesting charts already loaded after the test is complete? Can I apply a template chart somehow in the strategy code? I don't want to duplicate all of the indicator painting code in my strategy.

BTW, I finally got my first profitable strategy up and running last night! +$13K on the Sept ES with 10 contracts 6/1 to 6/30, 43% winning trades. I was up until 5am tweaking it and the < 50% success ratio worried me. Sure enough, the next day I ran it for the June ES for the 3 months previous and it failed miserably, too many trades entering at the very end of a trend move. Now I'm tired and (virtually) broke for the rest of the day. Oh well!

I'm really not looking for any holy grail indicator/system, I just want to automate the decision-making process I go through when I trade myself, automate some of my discretionary thinking, detecting price and volume breakouts, recognizing S/R levels, filtering trades against other time-frames, etc. as well as some high probability contrarian strategies (after large, rapids moves, scalp the short-term reversal)

Once I get some more consistent results I'll post up my progress.


Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
Warsh Confirmed 54-45 on PPI Day -- 97% Say He Holds in …
Prediction Markets & Event Contracts
Hormuz Normalization Collapses to 19.5% -- Iran Regime F …
Prediction Markets & Event Contracts
Pakistan Mediator in Tehran as Hormuz Normalization Coll …
Prediction Markets & Event Contracts
The Feds Stagflation Trap -- Negative Payrolls, $91 Oil, …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
  #2 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557


shodson View Post
I have a strategy that I am backtesting. When I backtest it, I get a chart with the prices and the entry and exit signals in it, but that's it. If I manually apply a template to the chart to add in the indicators I want to see it works, but once I run another backtest the indicators are gone again. Is there a way that I can have my indicators on the backtesting charts already loaded after the test is complete? Can I apply a template chart somehow in the strategy code? I don't want to duplicate all of the indicator painting code in my strategy.

Two ways:
1) Don't use the Chart feature within Strategy Analyzer, instead apply the strategy to a normal chart (File - New Chart), right-click, Strategy, add.

or, 2) Add the lines in the #initialize section of your strategy to Add() the indicators. Read up on NT's on-line help about Add(), but basically it's:

 
Code
                            
Add(Indicator(var1var2)); 

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 
jackyd's Avatar
 jackyd 
Calgary Canada
 
Experience: Intermediate
Platform: Ninja
Broker: IB/Kinetic
Trading: 6E, CL
Posts: 47 since Jun 2009
Thanks Given: 44
Thanks Received: 20


Another way to do it is to use the wizard to create the Add() code for you.

Just start a new strategy with the wizard, skip to the conditions screen, and build a condition with the indicator you're interested in. There's an option in the indicator settings called "Plot on chart" - set this to true. Then all you need to do is click on the View Code button and copy/past the code from the Initialize section into your custom strategy and then cancel out of the wizard.

Good luck, and may your next strategy be a profitable one!


Reply With Quote




Last Updated on July 1, 2009


© 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