NexusFi: Find Your Edge


Home Menu

 





Programmatically Remove Indicator


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: NQ / ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,801 since Aug 2009
Thanks Given: 11,742
Thanks Received: 3,018

I have been trying to create a script to refresh a strategy but nothing is working other than the F5 send keys which has multiple issues when programmed. (i.e. asking if I really want to refresh, chart not in focus creating errors, etc.)

I noticed that when a strategy is running I can manually add or remove an indicator to the chart and it will refresh without stopping the strategy.

I wonder if there is a way to add/remove a dummy indicator to a chart while the strategy is running.
If so, it would refresh the chart without the F5 problems.

If anyone has any ideas about this I would appreciate hearing about it.

Thanks


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on X Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
March Jobs Report Update: 178K Beat vs 59K Expected, Wag …
Traders Hideout
Iran Ceasefire Surges to 19.5% on US 15-Point Plan -- 82 …
Prediction Markets & Event Contracts
Iran Airspace Collapses 18 Points to 15.5% While Hormuz …
Prediction Markets & Event Contracts
Eurex Eyes Prediction Markets -- Europes Biggest Derivat …
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)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: NQ / ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,801 since Aug 2009
Thanks Given: 11,742
Thanks Received: 3,018

I forgot to mention this is for NT7.

I've not started using NT8 for live trading yet.


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on X Started this thread Reply With Quote
  #3 (permalink)
 TigerStripes   is a Vendor
 
Posts: 109 since Mar 2021
Thanks Given: 33
Thanks Received: 57



DavidHP View Post
I have been trying to create a script to refresh a strategy but nothing is working other than the F5 send keys which has multiple issues when programmed. (i.e. asking if I really want to refresh, chart not in focus creating errors, etc.)

I noticed that when a strategy is running I can manually add or remove an indicator to the chart and it will refresh without stopping the strategy.

I wonder if there is a way to add/remove a dummy indicator to a chart while the strategy is running.
If so, it would refresh the chart without the F5 problems.

If anyone has any ideas about this I would appreciate hearing about it.

Thanks

I am interested to know if there are work arounds that fix similar issues in NT8. I have written a code that is fairly large which has to incorporate an indicators code as the code requires a call of a secondary data series and that is unable to be done as a external indicator calling a data series and then allowing those variables on the secondary data series to be used in the main code. SO, that is not the issue, the issue is the indicator only runs successfully a x number of bars and then will stop visually updating. If I reset the indicator and have a larger period which visuals are to be drawn the historical visual value is accurate and still live there is a max number of bars the indicator can continue to calculate then it stops again.
I wonder if anyone knows how to code a programmatically stop in the indicator logic to then allow increment in the initial variables to display visuals and then have a function that will start the indicator a new using new updated variables.
ie. A counter it hides inside a period, when the counter is reached the period end, the indicator stops, updates new variables, then initiate indicator logic to start a new using set new period variables.

My edit N#1
I already have a counter and am able up update the indicator variables successfully though not able to implement any variables tied to the function of the indicator logic to stop it loading data that allows visuals to be drawn, so that it think the visuals are calculating even when not actually changing the visuals, so there is a total limit which is not reached visually but calculation max becomes the code stopping creating visuals at a new bar after x bars. I tired drawing dot and removing it and ForceRefresh() method which both to my test have made no difference on larger number of custom visuals by able to be conservativly drawn based on new bars.


Reply With Quote
  #4 (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


DavidHP View Post
I forgot to mention this is for NT7.

I've not started using NT8 for live trading yet.

Maybe using a text file that would contain a parameter to specify when it's time to turn on your indicator. You would just need to read this text file periodically to see if it has been updated.


Reply With Quote
Thanked by:




Last Updated on July 10, 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