NexusFi: Find Your Edge


Home Menu

 





Decoupling Strategy and Indicators: A new paradigm for Ninjatrader


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one vantojo with 10 posts (1 thanks)
    2. looks_two monpere with 7 posts (3 thanks)
    3. looks_3 terratec with 7 posts (3 thanks)
    4. looks_4 Fat Tails with 2 posts (0 thanks)
    1. trending_up 10,647 views
    2. thumb_up 7 thanks given
    3. group 10 followers
    1. forum 25 posts
    2. attach_file 2 attachments




 
Search this Thread

Decoupling Strategy and Indicators: A new paradigm for Ninjatrader

  #21 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

Yes, it is a matter of preference!

And personal background.

Good idea about bi-directional communication....

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Quantum physics & Trading dynamics
The Elite Circle
About a successful futures trader who didnt know anythin …
Psychology and Money Management
REcommedations for programming help
Sierra Chart
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
 
  #22 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,372


vantojo View Post
Yes, it is a matter of preference!

And personal background.

Good idea about bi-directional communication....

The communication structure is there, you just have to use it. My strategy reports back all sorts of info, like trade status, if the strategy is running, or paused, what account is it running under, equity, etc. The most important thing to me is that the indicator periodically polls the strategy and asks it are you alive?, to which the strategy better answer yes I am! Nothing frustrates me more then seeing a great trade but am unable to get in because the strategy was not alive for some reason. As a scalper those few seconds trying to fgure out what's going on, will cost me a trade.

Reply With Quote
  #23 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012



monpere View Post
The communication structure is there, you just have to use it. My strategy reports back all sorts of info, like trade status, if the strategy is running, or paused, what account is it running under, equity, etc. The most important thing to me is that the indicator periodically polls the strategy and asks it are you alive?, to which the strategy better answer yes I am! Nothing frustrates me more then seeing a great trade but am unable to get in because the strategy was not alive for some reason. As a scalper those few seconds trying to fgure out what's going on, will cost me a trade.

I have noticed at times the Ninja strategy (in the strategy tab) shows as active but it is not really....the OnBarUpdate appears not to be entered even though there is lots of price action. Is this what you are referring to?

Started this thread Reply With Quote
  #24 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,372


vantojo View Post
I have noticed at times the Ninja strategy (in the strategy tab) shows as active but it is not really....the OnBarUpdate appears not to be entered even though there is lots of price action. Is this what you are referring to?

Sometimes a strategy just stops responding, or is slow, or is in some startup mode, or I may have paused or stopped the strategy during the day and forgot to turn it back on, etc. The indicator periodically polls the strategy, and puts a status on the chart saying if the strategy is alive or not, so I know just by glancing at the chart that my strategy is running, paused or down.


Reply With Quote
Thanked by:
  #25 (permalink)
 terratec 
Zurich Switzerland
 
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515


vantojo View Post
I have noticed at times the Ninja strategy (in the strategy tab) shows as active but it is not really....the OnBarUpdate appears not to be entered even though there is lots of price action.

I also use a feedback function that shows me running/paused. That’s the visual part.
I did two things to solve the problem:

Leaving OnBarUpdate empty. Instead I use OnMarketData (and OnOrderUpdate, OnExecution). This way the strategy is much busier (and faster) and always ready. It is not that much CPU consuming as only a very little part of the code is active when I have no order or position. Most of the code is only active when a command or execution is on the way.

I did outsource every variable that does make any sense for both indicator and strategy to the global section. This way they always have something to chat (and keep themselves awake and ready. This brings the two parts – in a conceptual sense - closer together.

Off-topic: I did outsource the globals to a separate indicator that is always running in the background. All the problems like what to start first or errors when using multiple strategies or the (unwanted) reset of variables by changing time-frame, instrument etc. are gone.

Reply With Quote
Thanked by:
  #26 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

both comments are great...thank you....will be useful

Started this thread Reply With Quote




Last Updated on September 4, 2012


© 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