Anyone using TCP to communicate between Indicator and Strategy? - NinjaTrader Programming | futures io social day trading
futures io futures trading


Anyone using TCP to communicate between Indicator and Strategy?
Updated: Views / Replies:765 / 9
Created: by vantojo Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Anyone using TCP to communicate between Indicator and Strategy?

  #1 (permalink)
Elite Member
Neuquen, Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Favorite Futures: CL, TF, 6S, NG, sometimes GC
 
Posts: 195 since Jul 2012
Thanks: 25 given, 39 received

Anyone using TCP to communicate between Indicator and Strategy?

I'm using global variables to communicate between indicators and strategy and it is working pretty good.

But I would like to have the two communicate via TCP/IP on 127.0.0.1 and decouple the communication from the tick datafeed (i.e. OnBarUpdate, etc)

I've started the initial coding but it seems I am going to hit a lot of snags, since I have not coded TCP server/client before in C#.

Has anyone done this yet?

Thanks

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,574 given, 3,982 received


I did that, and you will easily find a bunch of socket examples.
On the same host it's more efficient and more "logic" to use named pipes.

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #4 (permalink)
Elite Member
Neuquen, Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Favorite Futures: CL, TF, 6S, NG, sometimes GC
 
Posts: 195 since Jul 2012
Thanks: 25 given, 39 received

reply

I would prefer to use TCP over Named Pipes so it could scale in the future across the internet.

But, I'm not finding the examples on BigMike....with the search...

Can you point me to one or two for Ninja Indicator/Strategy communication?

Thanks

Reply With Quote
 
  #5 (permalink)
Greenhorn Trader
Austin, TX
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: NT Broker
Favorite Futures: ES
 
Posts: 121 since Mar 2015
Thanks: 258 given, 68 received

Consider WCF if on Windows

I have used WCF to achieve inter-process communication on a Windows machine. This can be set up to be between machines over the local or even the internet. I found it a lot easier than trying to code the TCP interface.

Blessings & Good Trades
Reply With Quote
 
  #6 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,574 given, 3,982 received

It's pure C# so search for C# example like here , not NinjaScript examples.




vantojo View Post
I would prefer to use TCP over Named Pipes so it could scale in the future across the internet.

But, I'm not finding the examples on BigMike....with the search...

Can you point me to one or two for Ninja Indicator/Strategy communication?

Thanks


Success requires no deodorant! (Sun Tzu)
Reply With Quote
The following user says Thank You to sam028 for this post:
 
  #7 (permalink)
Elite Member
Neuquen, Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Favorite Futures: CL, TF, 6S, NG, sometimes GC
 
Posts: 195 since Jul 2012
Thanks: 25 given, 39 received

reply


sam028 View Post
It's pure C# so search for C# example like here , not NinjaScript examples.

Yes, I found lots of those.

Looks like I need to backup and study TCP, and not expect any plug in code to get this going quickly.

There is synchronous and it appears that starting a new Thread for this is best otherwise the TCP runs in the same thread as the strategy or indicator. So that includes both sides of the communication needing to be Threaded.

Then async is something different and .NET manages the Threads.

I have the server up and accepting connections, but in Ninja OnTermination I Stop() the server.listener and of course it does not like that....because the Listener is in a blocked state....

And, if I don't Stop() the listener OnTermination, then the IP Address/Port is locked and not available and the strategy cannot start the listener again.

And, on and on... :-)

Ok, this is a longer term project....

Reply With Quote
 
  #8 (permalink)
Elite Member
Neuquen, Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Favorite Futures: CL, TF, 6S, NG, sometimes GC
 
Posts: 195 since Jul 2012
Thanks: 25 given, 39 received

reply


GregLGTP View Post
I have used WCF to achieve inter-process communication on a Windows machine. This can be set up to be between machines over the local or even the internet. I found it a lot easier than trying to code the TCP interface.

OK, the initial view of WCF seems greatly simpler than TCP....I'll look further into it...

Thank you.

Reply With Quote
 
  #9 (permalink)
Elite Member
New York
 
Futures Experience: Advanced
Platform: NinjaTrader
 
Posts: 4 since Nov 2009
Thanks: 0 given, 1 received

Thanks guys, really appreciated.
I am starting from MSDN. I know I have to deal with Threads and doing in Ninja isn't so nice...

Anyway thanks to all!
I will keep you posted on the progression!
MrB

Reply With Quote
 
  #10 (permalink)
Elite Member
Neuquen, Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Favorite Futures: CL, TF, 6S, NG, sometimes GC
 
Posts: 195 since Jul 2012
Thanks: 25 given, 39 received

reply


After reading a little more it seems that WCF has more overhead than TCP.

What I decided to do was to bite the bullet and study TCP .NET when I get time. So, for me this project is on the back burner.

If anyone has done this in Ninja and is willing to share, please post your code.

Thanks

Reply With Quote

Reply



futures io > > > > > Anyone using TCP to communicate between Indicator and Strategy?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I communicate with a person who answered my question? wkniemann Traders Hideout 4 January 28th, 2013 06:27 PM
Indicator to a strategy cihde NinjaTrader Programming 5 October 10th, 2012 12:43 PM
How to call this indicator within the indicator/strategy zikonc NinjaTrader 2 July 26th, 2012 04:45 PM
Communicate Between Scripts webart NinjaTrader Programming 6 April 30th, 2010 03:42 PM
Ninja Strategy multi-timeframe issue/Strategy to indicator nw123 NinjaTrader Programming 2 December 20th, 2009 07:24 PM


All times are GMT -4. The time now is 06:31 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-17 in 0.11 seconds with 19 queries on phoenix via your IP 54.82.81.154