Said another way, can I receive events in a strategy and retrieve order information, if that order was not placed within the strategy?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Publish manual trades to Twitter
Collapse
X
-
Publish manual trades to Twitter
I'd like to use some library (perhaps this one: http://twittervb.codeplex.com/documentation or some other one) to publish trades I make to twitter as I place them. The thing is, these are manually placed trades in the DOM, not strategy-initiated trades. Is it possible to do something like this with a user-initiated trade?
Said another way, can I receive events in a strategy and retrieve order information, if that order was not placed within the strategy?Last edited by JoshDance; 05-08-2011, 01:16 PM.Tags: None
-
I'm trying now to open the log file. Here is my code:
Above that I define "path" this way:Code:protected override void Initialize() { Overlay = false; CalculateOnBarClose = false; Print("trying to open: " + path); if (File.Exists(path)) { try { sr = new System.IO.StreamReader(path); sr.ReadToEnd(); } catch (Exception e) {Print("Error reading file.");} } else Print("File does not exist."); }
My output window then says:Code:private string path = Cbi.Core.UserDataDir.ToString() + "log\\log.20110508";
trying to open: C:\Users\Josh\Documents\NinjaTrader 7\log\log.20110508
File does not exist.
But if I copy the exact string from the error message, I can go to notepad and paste it and open the file. Any ideas? This should be simple, not sure what's going on. And yes, the file actually exists and I can open it, and the date is correct.
Comment
-
Interesting thread. Perhaps this is reflecting my lack of knowledge regarding your problem, but wouldn't it be easier to use the SendMail() command and update twitter by email?
Regards,
Comment
-
I may in fact use that but right now the issue is that I have to get the data from somewhere, and the only solution I can think of for this particular problem is to do so via reading the log.Originally posted by J_o_s View PostInteresting thread. Perhaps this is reflecting my lack of knowledge regarding your problem, but wouldn't it be easier to use the SendMail() command and update twitter by email?
Regards,
Comment
-
I'm getting the following error:
That other process would obviously be NT, which has it open for read/write. Is there a way using the StreamReader(path) to open this as read-only, or is this even possible? I'm currently just doing:Error reading file. System.IO.IOException: The process cannot access the file 'C:\Users\Josh\Documents\NinjaTrader 7\log\log.20110509.txt' because it is being used by another process.
Edit: I just changed the code to try to open readwrite and it works:Code:sr = new System.IO.StreamReader(path);
Code:fs = new FileStream(path,FileMode.Open,FileAccess.Read,FileShare.ReadWrite); sr = new System.IO.StreamReader(fs);
Last edited by JoshDance; 05-09-2011, 08:36 PM.
Comment
-
Sure, but if I were you, I wouldn't base any trade decisions off of anything I do, unless you want your account to decline like mine has the last couple of weeks. This is more of an interesting exercise for me than anything else. I just switched my name last night so it may not show up yet, but it's "joshtrader" , let me know if you can find me. Also, I'm only posting executions as they happen, not when the order is placed, stop location, etc. From what I can tell so far, it posts to twitter to within about 2-3 seconds, not bad at all really.Originally posted by dennho View PostCan we see your Twitter feed when you are done? I guess your trades have to be seen by us somehow
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
581 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
338 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment