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 Quick Summary with 1 posts (0 thanks)
    4. looks_4 eDanny with 1 posts (1 thanks)
    1. trending_up 3,407 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?
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
Warsh Confirmed 54-45 on PPI Day -- 97% Say He Holds in …
Prediction Markets & Event Contracts
Hormuz Normalization Collapses to 19.5% -- Iran Regime F …
Prediction Markets & Event Contracts
Pakistan Mediator in Tehran as Hormuz Normalization Coll …
Prediction Markets & Event Contracts
The Feds Stagflation Trap -- Negative Payrolls, $91 Oil, …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,756 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,632


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)
Follow me on X 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,756 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,632

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)
Follow me on X 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