NexusFi: Find Your Edge


Home Menu

 





Multi Instrument Time Delay


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Jasonnator with 2 posts (0 thanks)
    2. looks_two Redmoon22 with 2 posts (0 thanks)
    3. looks_3 gregid with 1 posts (1 thanks)
    4. looks_4 ellinas with 1 posts (0 thanks)
    1. trending_up 1,543 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

Multi Instrument Time Delay

  #1 (permalink)
 Redmoon22 
Turkey
 
Experience: Intermediate
Platform: WHS Futurestation Nano
Trading: Futures
Posts: 2 since Mar 2015
Thanks Given: 1
Thanks Received: 0

Hi ,

is there a workable solution for time time delay problem in strategies with multiple instruments? If not, will the delay problem still be in NT8? I have searched and tried a lot, but still haven't found a good solution for this problem.

My Code:

protectedoverridevoid Initialize()
{

Add(Instrument2, PeriodType.Minute, 5); // Index [1]

}


protectedoverridevoid OnBarUpdate()
{

if ( BarsInProgress == 1 )
{
if (Closes[1][0] > Opens[1][0]) Signal = true;
// Signal Condition Ok at 10:00
}


if ( BarsInProgress == 0 && if (Signal == true) )
SubmitOrder( 0 , ... ) ;
// Order has to be submitted at 10:00

}


Instrument1 has Index0, Intrument2 has Index1.
The Signal comes from Instrument2(index1) at 10:00 and the Order in Instrument1(Index0) has to be submitted at 10:00. Since my Instrument1 hast Minute period 5, the orders is submitted at 10:05.

How can I also submit the order in Instrument1 at 10:00 ?
Please help me.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Deepmoney LLM
Elite Quantitative GenAI/LLM
ZombieSqueeze
Platforms and Indicators
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Are there any eval firms that allow you to sink to your …
Traders Hideout
Exit Strategy
NinjaTrader
 
  #3 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 650 since Aug 2009
Thanks Given: 320
Thanks Received: 623


Use timer event for this purpose, here is an example:

Reply With Quote
Thanked by:
  #4 (permalink)
 Redmoon22 
Turkey
 
Experience: Intermediate
Platform: WHS Futurestation Nano
Trading: Futures
Posts: 2 since Mar 2015
Thanks Given: 1
Thanks Received: 0

Thanks for the reply.. I couldn't figure out how to use the Event Timer, but I've found another "workaround".
I'm choosing period time 1 second for the Instrument with index 0, this way the time delay is acceptable for me.

Started this thread Reply With Quote
  #5 (permalink)
ellinas
Cyprus, Nico
 
Posts: 33 since Mar 2019
Thanks Given: 10
Thanks Received: 9


gregid View Post
Use timer event for this purpose, here is an example:

Hello friend,

do you have any idea/suggestion of how can I get the exact Time[0] at which a trade enters or exits? because I need to have this info in odrer me to write/insert a piece of code in my strategy –> I want to write a specific time delay (in seconds) after an exit/entry takes place. I need to get these times programmatically in ninjascript NT7.
Thank you/George

Reply With Quote
  #6 (permalink)
 
Jasonnator's Avatar
 Jasonnator 
Denver, Colorado United States
 
Experience: Intermediate
Platform: NT8 + Custom
Broker: NT Brokerage, Kinetick, IQFeed, Interactive Brokers
Trading: ES
Posts: 159 since Dec 2014
Thanks Given: 40
Thanks Received: 166

I think you should read through and understand the BarsInProgress property. Here is a link to the documentation. A simple if check to ensure you're acting on one data series versus another should alleviate your issue.

Make sure you continue to check on both your indicator and your strategy. Doing it on only one won't work.

Reply With Quote
  #7 (permalink)
 
Jasonnator's Avatar
 Jasonnator 
Denver, Colorado United States
 
Experience: Intermediate
Platform: NT8 + Custom
Broker: NT Brokerage, Kinetick, IQFeed, Interactive Brokers
Trading: ES
Posts: 159 since Dec 2014
Thanks Given: 40
Thanks Received: 166


ellinas View Post
Hello friend,

do you have any idea/suggestion of how can I get the exact Time[0] at which a trade enters or exits? because I need to have this info in odrer me to write/insert a piece of code in my strategy –> I want to write a specific time delay (in seconds) after an exit/entry takes place. I need to get these times programmatically in ninjascript NT7.
Thank you/George

There is an override provided for you which will give you exactly what you're looking for. Here is a link.

Reply With Quote




Last Updated on January 13, 2021


© 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