Thanks in advance to this amazing community!
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Trying to Read a Trade Signal From a CSV file and Execute the trade on MES
Collapse
X
-
Trying to Read a Trade Signal From a CSV file and Execute the trade on MES
I'm trying to create what I thought was a simple strategy to read a CSV file and execute the trade provided in the file. I have a strategy that produces the necessary trades and can append the trades to a CSV file. I created the ExecuteExternalSignals strategy in NT8 v 8.1.3.0. I got Namespace errors for line 67 when I tried to export the strategy. I've also included a copy of the signals file for reference. If anyone out there can help me get this working, I would be very grateful!!
Thanks in advance to this amazing community!Tags: None
-
Hello businessman1929,
NinjaTrader.Code.Utils is not a namespace made by NinjaTrader. This doesn't exist.
Where was this suggested to you?
What are you trying to do?
Are you trying to use a Dispatcher.InvokeAsync()?
What are you trying to invoke into? Are you trying to invoke into the script thread from the timer thread?
You may not need to depending on what you are trying to access.
If you are using data series information you would need to call TriggerCustomEvent.
Chelsea B.NinjaTrader Customer Service
-
Sorry Chelsea,
I'm new to coding in NinjaScript and I asked a buddy to help and did my best to work off of what he gave me. In it's simplest form, here's what I'm trying to do:- I have a python script that will be outputting trade signals to a csv file. When there's a trade signal I will have my script append the trade information to the bottom of the file.
- I want to have a strategy in NinjaTrader that will read the file every 60 seconds and execute any trades or modifications of stop losses for open trades that the csv file reflects.
Comment
-
Hello businessman1929,
You can read a text file with a C# StreamReader, which it appears you are understanding.
Below is a link to the reference sample which provides a working demonstration.
Specifically, what are you trying to do with the invalid line of code?
NinjaTrader.Code.Utils.InvokeAsync(ReadFileAndExec uteTrades);
Why was this invalid line of code added to the script?
What are you trying to do with this invalid line of code?
Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by David Hill, Today, 02:57 AM
|
1 response
28 views
0 likes
|
Last Post Today, 06:46 AM | ||
Started by ashwania, 05-23-2020, 04:10 PM
|
4 responses
470 views
0 likes
|
Last Post Today, 06:43 AM | ||
Started by sgordet, Today, 06:35 AM
|
0 responses
2 views
0 likes
|
Last Post
by sgordet
Today, 06:35 AM
|
||
Started by TheTechnician86, Yesterday, 05:47 PM
|
1 response
13 views
0 likes
|
Last Post Today, 06:24 AM | ||
Started by Ryan333, Yesterday, 05:25 PM
|
1 response
10 views
0 likes
|
Last Post Today, 06:22 AM |
Comment