My system has the ability to only take long trades, short trades only, or both. I have tested a strategy that only took long trades and the other took both. Is there a way to use the signals from long and short while only submitting them long? The strategy didn't perform as well when just using the entry logic for long trades. Any help is appreciated.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Long Trades Only
Collapse
X
-
Long Trades Only
Hello,
My system has the ability to only take long trades, short trades only, or both. I have tested a strategy that only took long trades and the other took both. Is there a way to use the signals from long and short while only submitting them long? The strategy didn't perform as well when just using the entry logic for long trades. Any help is appreciated.Tags: None
-
Hello durdcash,
If I understand correctly you want to change the short trades to also be long, if that is correct then you would just have to change the entry method in your code from short to long. The signals or conditions you use to trade would execute whatever logic you wanted once its true so that could be long or short orders.
-
NinjaTrader_Jesse I wasn't quite sure how to word it properly,
Here's an example, system 1 goes long one contract when macd crosses above zero and when there has been a recent cross above the sma. The system can also go short one contract when macd crosses below zero and when there has been a recent cross below the sma. Let's also say this can only happen within 3 bars of each other to make both conditions true at the same time to allow the trade.
Then lets say this system takes 40 trades 25 long and 15 short trades in the period I tested and Long trades net $10,000 while short trades were -$1,000. The long trades are really good over this period.
Now system two uses the same exact conditions but I only allow it to enter long trades. So instead of having 40 trades lets say it still took 30 trades for system two that went long. All the long trades it took are the same as system 1 that trades both ways but now it took an extra 5 trades because the conditions are true more often since it does not have the short trades entered and blocking the long. Now system 2 using the same settings only nets $7,000 because it lost another 5 trades that system 1 did not.
Is there a way to enter an actual position for long trades only, while when the short trade logic becomes true when not in a long trade it just simulates a trade or uses some time of block until the system would have exited based off my logic to allow another long to be taken again?
Comment
-
Hello durdcash,
You would have to program the strategy to do that type of task. If you don't want to enter short trades and just have it wait for that time you need to program it in that way. There is nothing in the user interface that you could use to change how the strategy is programmed to work, you need to make those kind of changes to its logic.
Comment
-
NinjaTrader_Jesse It appears I am not wording this the right way but I am not sure how else to write it. I already have logic to allow long trades only, short trades only, or both. I need both long and short signals to stop extra long trades from entering. I only want to actually enter the long trades. I get an extra 5 false signals when short trades are not turned on. Is there a way to tether a startegy to a sim account, then I could allow my live account to just take a trade when it is in a trade? Maybe that could done easier coding it in?
Comment
-
Hello durdcash,
I understand that you already have logic but you want it to now work differently. If that is the case you need to reprogram the strategy. There is nothing that I could provide here that would be a specific way to do that, this depends on what you originally coded. There are no ways to tie strategies together between accounts so if you want this to work a certain way on the live account its logic needs to reflect the end goal that you want to achieve.
Comment
-
NinjaTrader_Jesse I have been looking through the ninjatrader library. I see I can use account objects but not sure if they can be used this way . Could it be possible to add another condition where it looks at account position for sim and internally decides if it is allow to take the long trades?
Comment
-
Hello durdcash,
There is nothing that I could suggest to try and run multiple strategies and have them communicate, that is not how strategies are intended to be used.
You mentioned it has options to isolate long, short or use both sides but you want to have it work so you have both enabled but only long trades are taken. To do that would require editing its logic so it does not place short trades. Looking at a sim account for positions would not help with that type of task because you would still have to toggle the strategy to only take long trades with your setting which you said is not as good performance. You are still going to have to edit the original strategy to not place short trades if you want to use the logic from the both setting.My system has the ability to only take long trades, short trades only, or both. I have tested a strategy that only took long trades and the other took both. Is there a way to use the signals from long and short while only submitting them long? The strategy didn't perform as well when just using the entry logic for long trades. Any help is appreciated.
You are adding a lot of unnecessary complexity here by looking at alternate ways around the problem. The best solution is to adjust the logic of the strategy to work as you actually intended. If you want to use the both setting but have it place only long trades the best option is to edit the short side code to either do nothing or if you want those signals for additional long entries the short entry code needs to be changed to a long entry code.
Comment
-
NinjaTrader_Jesse So I believe one of your last comments helped. You said I could use the both setting but I could change something on the short side and the have it do nothing after those conditions become true. Now lets say the short conditions become true and then I have it do nothing. Let's say I create a bool where DoNothing=true.
Can I keep that bool true and have it register when we theoretically would have entered the short through another flag or something and then it would become reset and become false after my target, stop loss, or the end of the day happens for the short logic? Then when DoNothing=false it can either find a long trade or another short trade where it does nothing?
I understand this would require me to code things differently in some areas which is not the issue. I would figure it out. I just don't want tot try and do something if it would not go and work properly after all the coding
Comment
-
Hello durdcash,
Yes you could do that. As long as your long entry code is being blocked so it does not come true at that time you could do that.
If you remove the short entries that means for those periods of time when the condition for short becomes true your position is still flat. That means if programmed to use the position information it could enter long during those times if the long condition becomes true. If you use a bool in the way you described you would likely need to add that as part of your long entry conditions to make sure a long entry is not taken when a theoretical short position is in progress.
Comment
-
NinjaTrader_Jesse perfect. That should be doable since I am already using position logic and I know I can code the long entry block so it doesn't try to take that long trade when it should not. Thanks for the help! I will let you know if I run into any issues
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
44 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
65 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment