NexusFi: Find Your Edge


Home Menu

 





Identify Last [right-most] Candle on Static Chart


Discussion in NinjaTrader

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




 
Search this Thread

Identify Last [right-most] Candle on Static Chart

  #1 (permalink)
 Webby 
Simi Valley, CA
 
Experience: Intermediate
Platform: NinjaTrader 7
Broker: AMP Futures
Trading: Oil, Gold
Posts: 12 since Jun 2009
Thanks Given: 4
Thanks Received: 6

I would like to get some help in identifying when the last [right-most] candle has finished drawing on a "static" chart. By "static" chart, I mean that the chart is pulled up based on the data from the last time the Ninjatrader session was closed down/exited, and before the user "connects" manually via the menu option to the data provider to get the latest candles.

Let me share some information on why I need this. I have a function that needs to be triggered to run only on the last candle drawn on the static chart and not any older historical candles before that. I know about the History() function but am still having problems as even the last [right-most] candle is considered historical (on a static chart) before connection to the provider.

Thanks in advance for any suggestions and/or guidance.

Webby

Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
How to apply profiles
Traders Hideout
ZombieSqueeze
Platforms and Indicators
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #2 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


Webby View Post
Thanks in advance for any suggesions and/or guidance.

My thought would be to investigate using a timer (e.g 5 seconds or whatever) which is set on every 'Historical' bar that is processed in OnBarUpdate, thereby each incoming bar would simply reset the time condition and the timer itself would only actually fire on the last bar as you want.

It would obviously not be set at all when running live, and assumes that the specified delay is longer than the time to process each sequential historical bar (probably by a long margin) and short enough not to affect what you want to do (seems likely.)

You also might want to use the TriggerCustomEvent routine if it needs to be data safe within the Ninja data series areas.

I use this sort of technique for saving last bar of session data out to custom ascii files and guaranteeing to get all ticks in and it's been reliable.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote




Last Updated on March 11, 2014


© 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