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
enter once per candle
Collapse
X
-
Hello,
When you attach a strategy to a chart or the strategy tab you will be given the option to change the Entry handling. Please change this to UniqueEntries and only one order will be sent per Entry signal.
You can also accomplish this with the EntriesPerDirection field set to 1.Last edited by NinjaTrader_Ben; 09-12-2008, 08:30 AM.DenNinjaTrader Customer Service
-
I'd like to know more about preventing multiple entries per candle too.
The problem that I am trying to prevent is this:
1) Conditions are met for trade entry and a limit order is placed by the system with profit target and stop loss orders attached.
2) In that same candle, the profit target is met so the the position is then closed with the stop limit order.
3) However entry conditions still apply so NT then initiates another limit purchase order in the same bar.
I am trying to prevent part three happening - ie only one entry and exit position is allowable per bar.
It seems that UniqueEntries just prevents multiple concurrent positions , not sequential positions within the same bar.
I have no problems coding a solution, I'm just unsure what code is required to resolve this.
Thanks
Chris
Comment
-
Hello,
I suggest you use BarsSinceEntry(). For example:
// Only enter if at least 10 bars has passed since our last entry
if (BarsSinceEntry() > 10 && CrossAbove(SMA(10), SMA(20), 1))
EnterLong();
This link will help:
http://www.ninjatrader-support.com/H...inceEntry.htmlDenNinjaTrader Customer Service
Comment
-
Hi Ben
Thanks for the speedy reply.
BarsSinceEntry() didn't seem to work properly however I have resolved the issue now by setting, and testing for, a variable such as doneForSession if an entry and exit have been made for the candle.
This technique is used in this example code:
Many thanks for your help
Chris
Comment
-
Having trouble with multiple orders
I want to limit the number of active orders to just 1, I have tried the order handling techniques and the bars since entry but am having no success, can someone help me out here?
Comment
-
Please let me know how to code this
Originally posted by Operandi View PostHi Ben
Thanks for the speedy reply.
BarsSinceEntry() didn't seem to work properly however I have resolved the issue now by setting, and testing for, a variable such as doneForSession if an entry and exit have been made for the candle.
This technique is used in this example code:
Many thanks for your help
Chris
Please let me know how to code this.
Comment
-
Hello skann29,
Thank you for your post and welcome to the NinjaTrader Support Forum!
You can find the sample referenced at the following link: http://www.ninjatrader.com/support/f...ead.php?t=5790
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rene69851, 05-02-2024, 03:25 PM
|
1 response
20 views
0 likes
|
Last Post
by rene69851
Today, 08:20 PM
|
||
Started by ETFVoyageur, Yesterday, 07:05 PM
|
5 responses
43 views
0 likes
|
Last Post
by ETFVoyageur
Today, 08:08 PM
|
||
Started by jpeep, 08-16-2020, 08:31 AM
|
13 responses
487 views
0 likes
|
Last Post
by notenufftime
Today, 07:39 PM
|
||
Started by realblubb, 04-28-2024, 09:28 AM
|
2 responses
32 views
0 likes
|
Last Post
by realblubb
Today, 07:35 PM
|
||
Started by bmarovets, Today, 06:33 PM
|
0 responses
12 views
0 likes
|
Last Post
by bmarovets
Today, 06:33 PM
|
Comment