Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
ATM Strategy Limiting entries per direction
Collapse
X
-
Hello MisterGee,
I meant to ask if you would also advise what your settings are for EntriesPerDirection and EntryHandling.
-
Hello MisterGee,
Thanks for your post.
It is difficult to reply without the detail of your code. So that I can assist, please post your code or alternatively send in your strategy to PlatformSupport[at]Ninjatrader[dot]com with Atten:Paul and a link to this thread in the title.
Leave a comment:
-
Update
I found this solution to work perfectly when COBC is set to true.. when it is set to false orders are being submitted every tick, flat or not. I must've missed something?
Leave a comment:
-
Perfect, and the bool should remain false until the position is flat.
I will implement this. Thank you very much!
Leave a comment:
-
Hello MisterGee,
Thanks for your post.
With your code in OnBarUpdate() protecting again executing on other barsseries, adding the bools as previously posted should prevent multiple entries. Your code will execute once per tick from top to bottom of the code. Once the entry is sent the bool is set to false, on the next tick the bool will be false and no order should be sent.
Leave a comment:
-
I've been using COBC = false
I have:
if (bars in progress != 0)
Return;
In place, if that's what you're referring to?
Using the bool variable like this I can avoid using OnExecution ()?
Leave a comment:
-
Hello MisterGee,
Thanks for your post.
If I understand correctly you have an ATM strategy and you are placing entry orders based on MTF logic. Can you clarify if you are using CalculateOnBarClose = false? (This operates on each tick of the bar and as such conditional statements can quickly change and change back as the price oscillates).
Are you bracketing your entry logic according to the BarsInProgress? If not this would also cause multiple order as each bars object will call OnBarUpdate(). Please review the helpguide here for further references: http://ninjatrader.com/support/helpG...nstruments.htm
You can use bool logic to control entries once an entry condition has been met. For example:
if (your logic to enter a position && doitonce)
{
// entry order here
doitonce = false; // set this bool false so it will only perform the entry once
}
Later you would need logic to reset the bool so that when you next are ready to order you will be able to. A common way to do this is to reset when your are flat. For example:
if (Position.MarketPosition == MarketPosition.Flat)
{
doitonce = true; // reset for next entry order
}
Note: you would declare the bool in "region Variables" as follows;
private bool doitonce = true; // start with true
Leave a comment:
-
ATM Strategy Limiting entries per direction
I need some guidance limiting entries per direction with my MTF strategy. I am using operator comparisons for the conditions, but I would like it to behave as if it were a crossover condition, thereby only entering once per direction when all operator conditions have been met. I thought I would use a crossover condition for BarsArray[0] but I believe that would limit my entry opportunities too greatly.
I've read I should use OnExecution() and a bool variable, but frankly I don't understand how that works.
Thanks in advanceTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Nebula94, 04-15-2025, 02:41 AM
|
2 responses
30 views
0 likes
|
Last Post
![]()
by Nebula94
Today, 01:27 AM
|
||
Started by Mindset, Today, 12:46 AM
|
0 responses
9 views
0 likes
|
Last Post
![]()
by Mindset
Today, 12:46 AM
|
||
Started by moneymaster, Today, 12:38 AM
|
0 responses
5 views
0 likes
|
Last Post
![]()
by moneymaster
Today, 12:38 AM
|
||
Started by WilsonFoster, Yesterday, 11:35 PM
|
0 responses
12 views
0 likes
|
Last Post
![]()
by WilsonFoster
Yesterday, 11:35 PM
|
||
Started by MiCe1999, Yesterday, 09:26 PM
|
0 responses
16 views
0 likes
|
Last Post
![]()
by MiCe1999
Yesterday, 09:26 PM
|
Leave a comment: