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, 03-31-2026, 09:41 PM
|
1 response
47 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
23 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
33 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
51 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment