I'm working with forex.com to get my ninja trader account setup with them, but as far as the api goes with making these kind of If Then OCO trades, I was hoping someone could point me in the right direction.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Forex.com programmer here with a getting started question
Collapse
X
-
Forex.com programmer here with a getting started question
I already have a forex.com account and have been trading forex for a few months. I use a signal service that sends me emails of signals and I have a program to read the emails. The data they provide is the pair, if it's buy/sell, at what enter rate, and a stop/limit for the trade. I would then run my own code each day to figure out what pairs to trade based on my own strat and when I get those signals make the trades. It seems like I would be able to make those trades using ninja trader?
I'm working with forex.com to get my ninja trader account setup with them, but as far as the api goes with making these kind of If Then OCO trades, I was hoping someone could point me in the right direction.Tags: None
-
Hello,
Thank you for your forum post.
To clarify your asking on how you would go about coding NinjaTrader to submit OCO orders based on conditions? Are you wanting OCO for your profit target or stop loss or for your entry orders or both?
I look forward to assisting you further.BrettNinjaTrader Product Management
-
Correct, but those conditions are not based on rates. They are outside conditions to the market data itself. I get signals emailed to me, and I want to place orders based on those emails. I already have the coding to pull the emails automatically out so I have them to work with. So maybe I can use the scripting with Ninja Trader to read these from a file or database, and have the Ninja Trader scripting enter the deals based on that?To clarify your asking on how you would go about coding NinjaTrader to submit OCO orders based on conditions?
I want an If Then OCO. If the buy/sell rates hits x, get into the deal with y stop loss and z limit.Are you wanting OCO for your profit target or stop loss or for your entry orders or both?
Comment
-
You may be interested in Advanced Trade Management. This allows you to apply target and stop losses to orders that are automatically applied upon entry execution. These orders are OCO with no additional configuration needed.
See here for more information on Advanced Trade Management.
This is for discretionary entries and automatic exits.
If you want to fully automate your system, see here for the reference sample on reading from a file with NinjaScript:
Using StreamReader to read from a text file
Using System.IO File properties to write to and read from a text fileRyan M.NinjaTrader Customer Service
Comment
-
Cool, I'll take a look at reading a file.
Is there any other way to get external data into Ninja script? Maybe I could call a Ninja script function passing in some information from an outside source? The file thing works ok, just wondering what other options there are.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
22 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
120 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
63 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
45 views
0 likes
|
Last Post
|

Comment