NexusFi: Find Your Edge


Home Menu

 





Communicate Between Scripts


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one webart with 3 posts (0 thanks)
    2. looks_two sam028 with 2 posts (1 thanks)
    3. looks_3 eDanny with 1 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,506 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 webart 
Australia
 
Experience: Intermediate
Platform: NT
Posts: 106 since Apr 2010
Thanks Given: 48
Thanks Received: 84

Hi,

Does anyone know a coding example of how I could have a script (Ninja) reference another script to check for a True / False condition ? I want to have one script controller the order / stops, but reference the main script for a True / False entry / Exit rule every bar.

Also would that setup backtest ok ?


thx
Steve


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Talks Final Stages -- Two VLCCs Exit Hormuz, Record …
Traders Hideout
Pakistan Mediator in Tehran as Hormuz Normalization Coll …
Prediction Markets & Event Contracts
Second Night of US Strikes Crushes Iran June 15 to 3.6% …
Prediction Markets & Event Contracts
Ninjatrader users - good CONNECTIONs post and article fr …
NinjaTrader
Khamenei Vetoes Uranium Transfer as Peace Odds Surge to …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
1 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,758 since Jun 2009
Thanks Given: 3,828
Thanks Received: 4,644


It's not very clear, depends what "script" means to you.
Do you want:
#1 a strategy getting signals from another strategy ?
or
#2 a strategy getting signal from an indicator ?


Success requires no deodorant! (Sun Tzu)
Reply With Quote
  #4 (permalink)
 webart 
Australia
 
Experience: Intermediate
Platform: NT
Posts: 106 since Apr 2010
Thanks Given: 48
Thanks Received: 84

Yeah, one strategy getting a signal (True / False) from another strategy.

To elabortate,

2 Scripts, one that creates the signal (Script A) and the other that takes control once the signal is generated (Script B)

So script A generates a signal say it makes Variable1 = 1. Script be sees that and then enters a long position.


Started this thread Reply With Quote
  #5 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,758 since Jun 2009
Thanks Given: 3,828
Thanks Received: 4,644

You can check the links included in this post, not very tricky for pseudo-realtime.
For asynchronous communication, using simple file is maybe easier.


Success requires no deodorant! (Sun Tzu)
Reply With Quote
Thanked by:
  #6 (permalink)
 
eDanny's Avatar
 eDanny 
East Rochester, NY
 
Experience: Intermediate
Platform: NT
Posts: 329 since Jul 2009
Thanks Given: 18
Thanks Received: 425

If you are only dealing with True/False conditions you could set a BoolSeries in one strategy/indicator and expose it, then read it from strategy two, right?


Reply With Quote
Thanked by:
  #7 (permalink)
 webart 
Australia
 
Experience: Intermediate
Platform: NT
Posts: 106 since Apr 2010
Thanks Given: 48
Thanks Received: 84

Thanks for the replies, I'll check out that thread link. I was hoping it was going to be as easy as using multiple time frames from one strategy to another.

Your idea sounds good eDanny, just need to work out how to impliment it.

thx


Started this thread Reply With Quote




Last Updated on April 30, 2010


© 2026 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 - Downloads - Top
no new posts