OnBarUpdate not called for indicator within Stragety - futures io
futures io



OnBarUpdate not called for indicator within Stragety


Discussion in NinjaTrader

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




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

OnBarUpdate not called for indicator within Stragety

(login for full post details)
  #1 (permalink)
 corbeste 
Valencia/Spain
 
Experience: Intermediate
Platform: Investor/RT
Trading: FGBL, ES
 
Posts: 8 since Jun 2012
Thanks: 7 given, 13 received

Hi,

I am playing with the priceactionswing indicator, and am running into a big problem - within my strategy, the PAS OnBarUpdate method is never called! I cant find anything relating to specific instructions on how to include an indicator within a strategy, so I simply created the indicator within the Initialise function of my strategy.

However the PAS OnBarUpdate is never called (verified with a print statement) and the structures within the object are never populated. Init and OnStartUp are called.

Is there an obvious step I am missing to link the embedded indicator to the data series of the strategy? I am an experienced programmer but very new to the NT universe, so I am not clear on how the OnBarUpdate event works and how to allow the indicator to subscribe to this event.

 
Code
 protected override void Initialize()
        {
            CalculateOnBarClose = true;
	    pas = PriceActionSwing(Input, _dtbStrength, _swingSize, SwingTypes.Standard);

        }
		
		protected override void OnStartUp()
		{
			
		}

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
			Print (++_cnt);
                        // reference pas object contents

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Is there inherently more opportunity in smaller markets?
Traders Hideout
For the experts of Metastock
Platforms and Indicators
MacdBB V402 NT804 + gradient + pullback not working on N …
NinjaTrader
TD Sequential for NT or MW?
Platforms and Indicators
1 min chart v-shape scan help please
ThinkOrSwim
 
 
(login for full post details)
  #3 (permalink)
kandlekid
College Point, NY (Queens)
 
 
Posts: 63 since Nov 2009
Thanks: 5 given, 20 received



corbeste View Post
Hi,

I am playing with the priceactionswing indicator, and am running into a big problem - within my strategy, the PAS OnBarUpdate method is never called! I cant find anything relating to specific instructions on how to include an indicator within a strategy, so I simply created the indicator within the Initialise function of my strategy.

However the PAS OnBarUpdate is never called (verified with a print statement) and the structures within the object are never populated. Init and OnStartUp are called.

Is there an obvious step I am missing to link the embedded indicator to the data series of the strategy? I am an experienced programmer but very new to the NT universe, so I am not clear on how the OnBarUpdate event works and how to allow the indicator to subscribe to this event.

 
Code
 protected override void Initialize()
        {
            CalculateOnBarClose = true;
	    pas = PriceActionSwing(Input, _dtbStrength, _swingSize, SwingTypes.Standard);

        }
		
		protected override void OnStartUp()
		{
			
		}

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
			Print (++_cnt);
                        // reference pas object contents


I think your problem is that Initalize is only called once. You probably want to add the indicator to your plot using the Add method from Initialize then set pas from OnBarUpdate.

protected override void Initialize()
{
Add(PriceActionSwing( ...) );

}

protected override void OnBarUpdate()
{
pas = PriceActionSwing( ... );

...
}

Note: make sure that the arguments for the PriceActionSwing calls are precisely the same in both cases.

Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > OnBarUpdate not called for indicator within Stragety


Last Updated on August 13, 2013


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Our 12-year anniversary w/ $$,$$$ prizes (check soon)

August
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts