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 2,827 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

Communicate Between Scripts

  #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?
Futures True Range Report
The Elite Circle
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
 
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


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 Twitter 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,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

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 Twitter 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


© 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