Go Back   NinjaTrader Support Forum > NinjaTrader 8 > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 12-16-2016, 06:14 AM   #1
pmaglio
Vendor
 
Join Date: Oct 2007
Location: Argentina
Posts: 246
Thanks: 44
Thanked 31 times in 24 posts
Default Detecting if Historical when moving Playback slider

Hi,

I noticed that when using Playback, when we move the time slider the chart is replayed from beginning of day to the selected time and during all that time the reported State is RealTime

Not sure if this is this way by design or an error, but if it is this way by design, how can I detect from the code that we are not RealTime but just relocating the time slider to the new selected time ?

PS : Easy to test ;
Edit the Strategy SampleMACrossOver

if (CrossAbove(smaFast, smaSlow, 1))
{
Print("OnBarUpdate State = " + State.ToString() );
EnterLong();
}
else if (CrossBelow(smaFast, smaSlow, 1))
{
Print("OnBarUpdate State = " + State.ToString() );
EnterShort();
}
When we enable the strategy we get all the previous trades printed as "OnBarUpdate State = Historical"
Now if we move the time slider to a new date and/or time we get all trades printed as "OnBarUpdate State = Realtime"

Thanks

Pablo
pmaglio is offline  
Reply With Quote
Old 12-16-2016, 11:38 AM   #2
NinjaTrader_JessicaP
NinjaTrader Customer Service
 
NinjaTrader_JessicaP's Avatar
 
Join Date: Dec 2015
Location: Denver, CO
Posts: 2,435
Thanks: 210
Thanked 536 times in 517 posts
Default

Hello pmaglio,


I have submitted a feature request to the product management team for the following feature :

This customer would like NinjaScript strategies to have a distinct State when the playback connection is fast forwarding at maximum speed after the slider is advanced forward
I will follow up with more information as soon as it's available. If the feature requests already exists, a vote will be added to it.


Please let us know if there are any other ways we can help.
NinjaTrader_JessicaP is offline  
Reply With Quote
The following user says thank you to NinjaTrader_JessicaP for this post:
Old 12-19-2016, 08:24 AM   #3
NinjaTrader_JessicaP
NinjaTrader Customer Service
 
NinjaTrader_JessicaP's Avatar
 
Join Date: Dec 2015
Location: Denver, CO
Posts: 2,435
Thanks: 210
Thanked 536 times in 517 posts
Default

Hello again pmaglio,

This feature is being reviewed by the product management team and has been assigned the following unique tracking ID


SFT-1770


Please let us know if there is any other way we can help.
NinjaTrader_JessicaP is offline  
Reply With Quote
The following user says thank you to NinjaTrader_JessicaP for this post:
Old 11-29-2017, 12:46 PM   #4
pmaglio
Vendor
 
Join Date: Oct 2007
Location: Argentina
Posts: 246
Thanks: 44
Thanked 31 times in 24 posts
Default

Hi,
Is there any news about this ?
I need to detect if bars are historical or live playback after a user moved the time slider

Thanks !
pmaglio
NinjaTrader Ecosystem Vendor - The Indicator Store
pmaglio is offline  
Reply With Quote
Old 11-29-2017, 03:21 PM   #5
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO
Posts: 11,646
Thanks: 783
Thanked 2,012 times in 1,938 posts
Default

Hello Pablo,

Thank you for your post.

At this time there would not be an update on this item.

Please let me know if you have any questions.
NinjaTrader_PatrickH is offline  
Reply With Quote
Old 12-01-2017, 08:44 PM   #6
pmaglio
Vendor
 
Join Date: Oct 2007
Location: Argentina
Posts: 246
Thanks: 44
Thanked 31 times in 24 posts
Default

Quote:
Originally Posted by NinjaTrader_PatrickH View Post
Hello Pablo,

Thank you for your post.

At this time there would not be an update on this item.

Please let me know if you have any questions.
Is there any other way to do this ?
I mean, if a user selects to start a playback at 10am, how can I identify that between 0 and 10am it is not RealTime ? so we can avoid playing sounds, sending emails, etc....

Thanks !
pmaglio
NinjaTrader Ecosystem Vendor - The Indicator Store
pmaglio is offline  
Reply With Quote
Old 12-04-2017, 10:44 AM   #7
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO
Posts: 11,646
Thanks: 783
Thanked 2,012 times in 1,938 posts
Default

Hello pmaglio,

Thank you for your response.

There would not be a means around the State reporting as Realtime in this scenario.
NinjaTrader_PatrickH is offline  
Reply With Quote
Old 03-10-2018, 10:14 PM   #8
pmaglio
Vendor
 
Join Date: Oct 2007
Location: Argentina
Posts: 246
Thanks: 44
Thanked 31 times in 24 posts
Default

𝔸𝕟𝕪 ℕ𝕖𝕨𝕤 ?
We cant still avoid sending emails or playing sounds when a user rewinds the playback
pmaglio
NinjaTrader Ecosystem Vendor - The Indicator Store
pmaglio is offline  
Reply With Quote
Old 03-13-2018, 06:38 AM   #9
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO
Posts: 11,646
Thanks: 783
Thanked 2,012 times in 1,938 posts
Default

Hello pmaglio,

Thank you for your post.

There is no update on this feature request at this time.

I would like to note that you could implement a check for something outside the NinjaScript based events, such as a button on the chart that you add. Add the button to the chart through NinjaScript and then select the button when changing playback times and check for that button as selected in your code to avoid any unwanted actions being taken.

Please let me know if you have any questions.
NinjaTrader_PatrickH is offline  
Reply With Quote
Old 03-13-2018, 12:09 PM   #10
pmaglio
Vendor
 
Join Date: Oct 2007
Location: Argentina
Posts: 246
Thanks: 44
Thanked 31 times in 24 posts
Default

yes, I know. This is what Im doing now....
....just not so practical as it sounds if doing lot of replays having lot of indicators
pmaglio
NinjaTrader Ecosystem Vendor - The Indicator Store
pmaglio is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
playback with historical dtl-saw Version 8 Beta 1 09-07-2016 11:04 AM
NT8 B11 - Moving the slider back to the start - no data replayed sledge Version 8 Beta 1 05-30-2016 02:16 PM
Trend Slider moving automatically zibaus Platform Technical Support 7 10-22-2014 07:55 AM
Playback historical data TradingDreamer Platform Technical Support 2 08-29-2011 04:05 PM


All times are GMT -6. The time now is 04:39 PM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.