Thanks.
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
Bars Since Entry/Exit
Collapse
X
-
Bars Since Entry/Exit
When I am using Bars Since Entry/Exit with a numeric value like 2 or 3 in Strategy Builder, the strategy does not take any trades. Why? Isn't Bars since Entry/Exit supposed to prevent it from taking a trade if it is less than number of bars specified?
Thanks.Tags: None
-
Hello Trader17,
It is likely the SignalName not being present that is preventing this from working. Did you use an exit order from a condition or the stops and targets section?
If you used the stops and target sections, you need to fill in the "SignalName" with what you see in the control center order tab name column. A stop loss would need to be "Stop loss" with the same capitalization as what you see in the control center.
If you used an exit order, you need to specify the same signal name as you did with the exit.
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
- Likes 1
Comment
-
Hello Trader17,
The items to fill in can be left at 0's unless you want to use BarsSinceExitExecution in a more advanced way. You can find descriptions of all the items you see here in the help guide. https://ninjatrader.com/support/help...=barssinceexit
The signal name is what I had explained in the last post. You need to specify which exit you are referring to with the Signal Name. If you had used the set stops and targets or reversed your position, there are specific names for those orders otherwise this is something you customize when you submit the exit. In the control center orders tab, if you look for your exit order and then look in the Name column that will be the name to use here. For a reversal you should see Close position, so you would use Close position matching the capitalization in the Name column exactly.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
- Likes 1
Comment
-
Comment
-
Hello Trader17,
This is a normal message, this just indicates that your strategy tried to trade before the BarsRequiredToTrade. Bars Required To Trade is a property you set when configuring the strategy in the user interface and defaults to 20 bars. This is found in the "Set up" properties of your strategy when you apply it.
Were you able to see the strategy working past the 20 first bars in that test? If the condition is still not working, could you provide an image of what you updated the builder to? Also were your other entries/exits working and could you see that on the chart?
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
- Likes 1
Comment
-
Hello Trader17,
Was that due to the strategy trying to place trades before the 20 bars? That warning would indicate your conditions became true in that test and it was submitting orders. If no orders were submitted and then exited after the 20 bars the BarsSinceExit wouldnt apply to anything.
You may try changing the entry condition to be more specific or ensure it occurs after the BarsRequiredToTrade to ensure a entry and exit occur.
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
- Likes 1
Comment
-
I am using On Close of bar and not per tick or trade. Could that be the issue? Also I have way more than 20 bars. I think I test on like a month of data at least. Can you please make a video with a sample strategy and add it in there and see if it works?
Thank you.
Comment
-
Hello Trader17,
The Calculate setting will change how the script calculates, but in historical data this has no effect so this would not be related to your problem. This would only affect the strategy in realtime.
The warning you had seen in post 9 tells me that your conditions are becoming true but they did so right away before 20 bars. If you are looking at a chart, bar 0 is the leftmost bar and where your script starts processing data. Your conditions became true before the 20th bar which is the reason for that warning. This has nothing to do with the total number of bars you have but when your conditions became true specifically. If they did not become true again after that point, your BarsSinceExitExecution would have nothing to reference as there should be no exits.
In regard to a video, because you are also having difficulty with getting any trades at all, we have a video that covers creating a full strategy here: https://youtu.be/HCyt90GAs9k
I would suggest starting with creating a basic strategy that enters and exits trades or reverses trades like the video. Once you have a strategy that produces trades beyond the 20 first bars on the chart, you could expand on that with other logic such as BarsSinceExitExecution. Having the entry and exit logic working will be an important requirement before moving to exit based logic. If the exit does not happen that will make it very difficult to debug what is happening further down the line in your logic.
Please let me know if I may be of additional assistance.JesseNinjaTrader Customer Service
- Likes 1
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by bortz, 11-06-2023, 08:04 AM
|
47 responses
1,606 views
0 likes
|
Last Post
by aligator
Today, 07:22 PM
|
||
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
9 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
19 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
6 views
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
15 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
Comment