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 CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
52 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
30 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
194 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
355 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
274 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|

Comment