Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Increment or Counter in the Strategy Builder?
Collapse
X
-
Can anyone tell me how I can do this in Strategy Builder?Originally posted by mcosta72 View PostHello WattMan, you can try this:
protected override void OnPositionUpdate(Cbi.Position position, double averagePrice, int quantity, Cbi.MarketPosition marketPosition)
{
if (position.MarketPosition == MarketPosition.Flat)
{
if (SystemPerformance.AllTrades.Count >= 1)
{
Trade lastTrade = SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 1] ;
double res = lastRTTrade.ProfitCurrency * lastRTTrade.Quantity;
if(res < 0)
stop += 1;
if(res > 0)
target += 1;
}
}
}
Comment
-
There is an example of a Counter by NinjaTrader_PaulH in the forums that counts crosses. Not sure if system performance objects can be counted using Builder.Originally posted by lovelean View Post
Can anyone tell me how I can do this in Strategy Builder?
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
87 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
132 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
65 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
118 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
67 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment