How to avoid conflict while writing to text file from NT indicator - NinjaTrader Programming | futures io social day trading
futures io futures trading


How to avoid conflict while writing to text file from NT indicator
Updated: Views / Replies:2,475 / 4
Created: by zsrs 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
 

How to avoid conflict while writing to text file from NT indicator

  #1 (permalink)
Elite Member
Ajax, Ontario, Canada
 
Futures Experience: Beginner
Platform: Ninjatrader, MultiCharts
Favorite Futures: ES
 
Posts: 2 since Dec 2010
Thanks: 0 given, 0 received

How to avoid conflict while writing to text file from NT indicator

Hi ,

I am tring to make a custom indicator in NT7 write to a text file when all conditions are met, this text file will be monitored every 1 second by another 3rd party program.

This is how it works:

1, When all conditions are met, the custom indicator write a new line to the text file, named "output.txt" for example.

2, Every 1 second, the 3rd party open the "output.txt" text file and see if a new line has been written to the file, if yes, then it will read this line into its own platform, and delete the entire content of the "output.txt" text file.

Based on my understanding, there are two methods to write to a text file from Ninjatrader indicators, one is StreamWriter, the other is System.IO File properties.

My question is:

What would happen if when the 3rd party is opening the "output.txt" text file, the NT indicator is trying to open and write to the same file at the same moment? Will there be any conflict or error message? Is there anyway to avoid this?

Any help will be greatly appreciated, 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)
Elite Member
Near the BEuTiFULL Horse Shoe
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: MBTrading Dukascopy ZenFire
Favorite Futures: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 176 received


There is a very good discussion on options available in this thread
Problem writing to file during strategy optimisation - NinjaTrader Support Forum

Reply With Quote
The following 2 users say Thank You to Trader.Jon for this post:
 
  #4 (permalink)
Elite Member
Ajax, Ontario, Canada
 
Futures Experience: Beginner
Platform: Ninjatrader, MultiCharts
Favorite Futures: ES
 
Posts: 2 since Dec 2010
Thanks: 0 given, 0 received

Thank you very much, Trader.Jon.

Reply With Quote
 
  #5 (permalink)
Elite Member
California
 
Futures Experience: Intermediate
Platform: NinjaTrader, TOS
Favorite Futures: CL, TF, Options & Stocks
 
Posts: 50 since Jun 2013
Thanks: 322 given, 26 received


zsrs View Post
Hi ,

I am tring to make a custom indicator in NT7 write to a text file when all conditions are met, this text file will be monitored every 1 second by another 3rd party program.

This is how it works:

1, When all conditions are met, the custom indicator write a new line to the text file, named "output.txt" for example.

2, Every 1 second, the 3rd party open the "output.txt" text file and see if a new line has been written to the file, if yes, then it will read this line into its own platform, and delete the entire content of the "output.txt" text file.

Based on my understanding, there are two methods to write to a text file from Ninjatrader indicators, one is StreamWriter, the other is System.IO File properties.

My question is:

What would happen if when the 3rd party is opening the "output.txt" text file, the NT indicator is trying to open and write to the same file at the same moment? Will there be any conflict or error message? Is there anyway to avoid this?

Any help will be greatly appreciated, thanks!


Hi,

Can you pls share the code. I have similar requirement.

Reply With Quote

Reply



futures io > > > > > How to avoid conflict while writing to text file from NT indicator

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
Plotting text in indicator panel ibiscmllc NinjaTrader Programming 2 November 19th, 2010 08:56 AM
Need help with writing a strategy for NT Eagle01 NinjaTrader Programming 1 October 20th, 2010 10:38 AM
How to check which indicators are in a NT chart-template-file max-td Beginners and Introductions 2 June 17th, 2010 11:58 AM
Indicator with variable Text on Chart Henrik EasyLanguage Programming 6 May 14th, 2010 02:01 PM
Writing & reading data into/out of NT Saroj NinjaTrader Programming 1 September 12th, 2009 04:55 PM


All times are GMT -4. The time now is 06:52 PM.

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-16 in 0.10 seconds with 19 queries on phoenix via your IP 54.145.16.43