NexusFi: Find Your Edge


Home Menu

 





Programmatically Remove Indicator


Discussion in NinjaTrader

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




 
Search this Thread

Programmatically Remove Indicator

  #1 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,612 since Aug 2009
Thanks Given: 11,341
Thanks Received: 2,747

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 Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Trade idea based off three indicators.
Traders Hideout
Quant vue
Trading Reviews and Vendors
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
What broker to use for trading palladium futures
Commodities
 
  #2 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,612 since Aug 2009
Thanks Given: 11,341
Thanks Received: 2,747

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 Twitter Started this thread Reply With Quote
  #3 (permalink)
 TigerStripes   is a Vendor
 
Posts: 109 since Mar 2021
Thanks Given: 33
Thanks Received: 56



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
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,527 since Oct 2009
Thanks Given: 4,176
Thanks Received: 6,020


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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts