NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 09-20-2009, 06:08 PM   #1
astrolobe
Senior Member
 
Join Date: Oct 2007
Location: Sydney
Posts: 311
Thanks: 0
Thanked 0 times in 0 posts
Default SampleStreamWriter

Is it possible to write to the same output file from a strategy that is running concurrently on different instruments?
I have a strategy that is running on five different currencies at the same time, and I would like each instance to update the same text file as orders are executed.
I understand that you cannot read and write to the same file at the same time, but can you write to the same file from multiple sources at the same time?

thanks.
astrolobe is offline  
Reply With Quote
Old 09-21-2009, 06:39 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

astrolobe, I believe you can only have one working Stream object working at the same time.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 09-21-2009, 09:41 AM   #3
Ralph
Senior Member
 
Join Date: Jul 2008
Posts: 527
Thanks: 0
Thanked 9 times in 6 posts
Default

Astrolobe, I think you could do everything setting up this constructor accordingly:

public FileStream(
string path,
FileMode mode,
FileAccess access,
FileShare share
)

Regards
Ralph
Ralph is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SampleStreamWriter Example dnokes General Programming 2 12-23-2008 09:09 AM


All times are GMT -6. The time now is 06:24 AM.