NexusFi: Find Your Edge


Home Menu

 





Communication between strategies


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one zwentz with 2 posts (1 thanks)
    2. looks_two sefstrat with 1 posts (3 thanks)
    3. looks_3 jthom with 1 posts (0 thanks)
    4. looks_4 gregid with 1 posts (2 thanks)
    1. trending_up 3,607 views
    2. thumb_up 6 thanks given
    3. group 5 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Communication between strategies

  #1 (permalink)
 zwentz 
Austin, TX
 
Experience: Advanced
Platform: NinjaTrader
Broker: Optimus Futures/Rithmic
Trading: Futures [ZB]
Posts: 36 since Sep 2009
Thanks Given: 12
Thanks Received: 22

I'm trying to communicate between strategies in NinjaTrader and I don't want to use IO. I'd like something faster and a bit easier to implement in other strategies later. I'm thinking of a parent console application that manages the communication between them all, but I'm wondering what other solutions you've come up with.

To date I've tried communicating via windows messages, which didn't work because of the limitations of NinjaTrader as well as cross thread communication and IPC, but the threads aren't Thread Pool and IPC won't work for the same reasons windows messages won't work.

So before I go balls to the wall with my console manager, I was wondering if anybody had come up with something better or just an alternative, as I'd rather not do this. At this point, it may be my only option though.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
Cheap historycal L1 data for stocks
Stocks and ETFs
NexusFi Journal Challenge - May 2024
Feedback and Announcements
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
76 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
37 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
17 thanks
  #2 (permalink)
 
sefstrat's Avatar
 sefstrat 
Austin, TX
 
Experience: Advanced
Platform: NT/Matlab
Broker: Interactive Brokers
Trading: FX majors
Posts: 285 since Jun 2009
Thanks Given: 20
Thanks Received: 768

you could use .net remoting, or any of the open source message bus programs for .net.. there are several of them on codeplex and/or googlecode, most include a console message host, no need to roll your own =)

i use masstransit (not with NT but in some other applications)
masstransit - Project Hosting on Google Code

Reply With Quote
Thanked by:
  #3 (permalink)
 zwentz 
Austin, TX
 
Experience: Advanced
Platform: NinjaTrader
Broker: Optimus Futures/Rithmic
Trading: Futures [ZB]
Posts: 36 since Sep 2009
Thanks Given: 12
Thanks Received: 22


Nice sefstrat; precisely what I was looking for. And the ability to make it a background process is awesome!

Edit:

I am finding it incredibly difficult to get setup with Mass Transit, I can't even get their samples to work. Their documentation is sparse to put it best, and there seems to be no correlation between the documentation they do have and their actual source code available for download. Can you provide an abstract version of how you're doing it? I don't want to steal your code or anything, but maybe just give an idea of how to even get started with it?

EditEdit:

I found a better implementation, at least for me, that I seem to be having some luck with. NServiceBus, I was able to get up and running in about 2 minutes compared to the all day event that was Mass Transit. There's another good looking service bus implementation called Rhino. Anyway, just because it didn't work for me doesn't mean it won't work for someone else, I'm just including these others so people will know their options. Thanks again, sefstrat.

Started this thread Reply With Quote
Thanked by:
  #4 (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

More light weight approach to communication between strategies:

Data Transfer between Strategies - [AUTOLINK]NinjaTrader[/AUTOLINK] Support Forum

For mere mortals

Reply With Quote
Thanked by:
  #5 (permalink)
 jthom 
Sydney / Australia
 
Experience: Intermediate
Platform: NT
Broker: AMP
Trading: Oil
Posts: 118 since Jun 2009
Thanks Given: 128
Thanks Received: 105

Though just what I need, I am finding these programs incredibly difficult to use.


I have been trying to develop a method to run two strategies at once.
One strategy is to calculate the signal. (Calculate on Bar Close = true) It then sends the Close[0] price to the 2nd strategy once the signal = true. The 2nd strategy (Calculate on Bar Close = false) places a limit order 2 ticks +- the Close[0]. So if the price moves away from the order without being filled, a cancel order can be initiated.

Now I have looked at the DataTransfer Class and am completely lost as to how to setup communication. As I recall, it simply calculated PnL figures.
Using these 3rd party programs with VS seems a little difficult.

Any ideas on how to implement this?

Many thanks

Reply With Quote




Last Updated on May 2, 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