protected override void OnBarUpdate()
{
// Only trade if you have less than 5 consecutive losers in a row
if (Performance.RealtimeTrades.TradesPerformance.MaxConsecLoser < 5)
{
// Trade logic here
}
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy Performance Methods and Partial Entires/Exits
Collapse
X
-
Strategy Performance Methods and Partial Entires/Exits
Reading in the v6 help guide, I see that we can access the maximum number of consecutive losers for our strategy trades. For example:
Now, if I want to use partial exits, I enter with two orders--one for the partial position (signal name "Target") and one for the rest of the position (signal name "Trail"). Say I get stopped out on the pair, which is really one single position according to my trade system, but is two "positions" according to NinjaScript. MaxConsecLoser is going to return 2, not 1 like I want. How can I reference the MaxConsecLoser only for the trades from the "Target" signal-named orders?Code:Tags: None
-
Yes. Two unique entries with two different names. I want to get MaxConsecLosers for each named entry separately.
Comment
-
Just to doublecheck on this one:
I have three signals that reverse from Long to Short (1 contract each).
If I apply the Strategy and the Strategy calculates on Historical to L3,
then I syncronize by Buying 3 contracts.
Now when real time data come in, if any of the
short signals fires first, a liquidation of the 3 longs is followed with
an entry of 1 short (i.e., 4 shorts).
(I use UniqueEntries)
How do i fix this. Can NT handle multiple reversals within a single script.
Do I have to use separate strategies?
Thanks,
Comment
-
I'm not sure I follow trend, what counts is the overall net strategy position for the instrument, this has to be in sync with the account position you execute to. If you don't want to sync up and start trading this live with the first real time generated signal, just use 'WaitUntilFlat' then as 'On starting a real time strategy option' under Tools > Options > Strategies > NinjaScript - http://www.ninjatrader-support.com/H...tegiesTab.html
Comment
-
I guess what I'm asking is:
I understand you can have in a script
EnterLong(1, "L1"); and
EnterShort(1, "S1");
but can you have multiple Longs/Shorts
in a single script?
that is,
EnterLong(1, "L1"); and EnterShort(1, "S1");
(they will reverse each other)
bur also to add
EnterLong(1, "L2"); and EnterShort(1, "S2");
within the same script.
Thanks,
Comment
-
Well, as I described above I test
a few signals
EnterLong(1, "L1"); and EnterShort(1, "S1");
(they reverse each other)
EnterLong(1, "L2"); and EnterShort(1, "S2");
and
EnterLong(1, "L3"); and EnterShort(1, "S3");
If I get a position 3L on Historical and syncronize with 3 long
contracts, then if a short signal is generated on real-time data
then I get a liquidation of ALL 3 longs plus the short
How do I set
EntryHandling,
EntriesPerDirection
and Stop& Target Submission
to make sure that if signal L1 is long and the S1 fires I'll
get an execution of 2 shorts, without affecting the position of signals
2 & 3 (?)
Thanks,
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
639 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
366 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
107 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
569 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
572 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment