Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy conditions
Collapse
X
-
You could work with flags for this or change your strategy conditions for entry, most people have this issue because they don't work with CrossAbove / CrossBelow, but just with checking for if something is greater or smaller than a previous value. This of course will evalualate to true longer than 1 bar in most cases. Another way might be to record the barnumber the trade is placed on and then waiting for x bars to pass before another entry is permissioned.BertrandNinjaTrader Customer Service
-
Originally posted by NinjaTrader_Bertrand View PostYou could work with flags for this or change your strategy conditions for entry, most people have this issue because they don't work with CrossAbove / CrossBelow, but just with checking for if something is greater or smaller than a previous value. This of course will evalualate to true longer than 1 bar in most cases. Another way might be to record the barnumber the trade is placed on and then waiting for x bars to pass before another entry is permissioned.
Bertrand, great thinking. I have actually tried all of the above to no prevail except for barnumber. I tried a barnumber technique before but it did not work and someone said that it doesn't work with ATM methods (BarsSinceEntry() ).
So how would you record the barnumber for example? Would it be in the ATM or in the Strategy?
Thanks
Comment
-
You can do it directly in the strategy itself, when your conditions trigger for example a long entry (and you flag permits the entry) and the GetAtmStrategyMarketPosition reports you're long (http://www.ninjatrader-support.com/H...yPosition.html) you can save the current bar to a variable to get the entry barnumber. Then you can set / reset a flag with this info to toggle if further entries are allowed or not.BertrandNinjaTrader Customer Service
Comment
-
Ok let me know if this is right:
privateint barNumberOfOrder = 0;
// Condition set 1
if (Open[0] > EOTVramBars(0.65, 1.3, true).VramUpConfirm[0]
&& orderId.Length == 0
&& atmStrategyId.Length == 0
&& CurrentBar > barNumberOfOrder + 10 )
{
atmStrategyId = GetAtmStrategyUniqueId();
orderId = GetAtmStrategyUniqueId();
AtmStrategyCreate(Action.Buy, OrderType.Market, 0, 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);
barNumberOfOrder = CurrentBar;
}
So that will only execute trade after 10th bar from previous trade?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by usazencort, Today, 01:16 AM
|
0 responses
1 view
0 likes
|
Last Post
by usazencort
Today, 01:16 AM
|
||
Started by kaywai, 09-01-2023, 08:44 PM
|
5 responses
603 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by xiinteractive, 04-09-2024, 08:08 AM
|
6 responses
22 views
0 likes
|
Last Post Today, 12:31 AM | ||
Started by Pattontje, Yesterday, 02:10 PM
|
2 responses
20 views
0 likes
|
Last Post
by Pattontje
Yesterday, 11:49 PM
|
||
Started by flybuzz, 04-21-2024, 04:07 PM
|
17 responses
230 views
0 likes
|
Last Post
by TradingLoss
Yesterday, 11:45 PM
|
Comment