Thank you
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
two different buy in one strategy
Collapse
X
-
two different buy in one strategy
Hi. Running strategy builder, How can I run two different buy in one strategy. Say (A)one is MA cross over 5 and 10 then buy, (B)other is MA cross over 20 and 40 then buy. I cant figure it out. Tried different order handling settings but not working out. If I leave it at unique entry at 2, if A occurs twice before B happens, system buys 2 A signals but not B which happens later in time.
Thank youTags: None
-
Thank you for your question.
This is exactly the situation signals were designed for. Attached is a code sample that should do something like what you are describing. Code samples we provide are for educational purposes, and are not intended for live trading, and are not guaranteed to accomplish any user goal or to be maintained.
Please also note that EntriesPerDirection was set to 2.
Please let us know if there are any other ways we can help.
Resources :
- Entering with signals : https://ninjatrader.com/support/help.../enterlong.htm
- Using signals with stops and targets : https://ninjatrader.com/support/help...ofittarget.htm
- EntriesPerDirection : https://ninjatrader.com/support/help...rdirection.htm
Attached FilesJessica P.NinjaTrader Customer Service
-
Hi, Jessica.
After taking a look at your video, I still have trouble. If I leave order handling to 2, if A occurs twice, then B, system will buy two As but not B. and it averages stop as a whole unit. I want to have A with one entry with its own $200 stop and B with 1 entry with its own $200 stops. does this make sense to you? So two unique strategies under 1 strategy.
Thank you
Comment
-
For this situation, we have created the EntryHandling property. This property relies on signals which we've already discussed and implemented. When we set EntryHandling.UniqueEntries and set the EntriesPerDirection to 1, we make it so that there can be at most 1 entry per unique name. In our case, our unique names are "TradeSet1" and "TradeSet2", which means at most 1 contract can be launched from the 5/10 crossover and 1 from the 20/40 crossover.
This help guide page has more information.
I prepared a short video where I implement these settings.
Jessica P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by johnnymustard, Today, 09:52 AM
|
0 responses
1 view
0 likes
|
Last Post Today, 09:52 AM | ||
Started by SnailHorn, 03-27-2024, 09:54 AM
|
4 responses
17 views
0 likes
|
Last Post
by SnailHorn
Today, 09:19 AM
|
||
Started by ninza33, Today, 07:16 AM
|
3 responses
18 views
0 likes
|
Last Post
by ninza33
Today, 09:01 AM
|
||
Started by foxtrott21, Today, 08:27 AM
|
0 responses
4 views
0 likes
|
Last Post
by foxtrott21
Today, 08:27 AM
|
||
Started by jaypelle3, Today, 08:26 AM
|
0 responses
3 views
0 likes
|
Last Post
by jaypelle3
Today, 08:26 AM
|
Comment