Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
OCO order error
Collapse
X
-
I wil try tomorrow and let you know.
Look at this code, maybe is something wrong?
this.SetProfitTarget(CalculationMode.Price, this.takeProfit);
//this.SetProfitTarget(this.takeProfit);
Print("Stop loss Orden " + this.valorStop);
this.SetStopLoss(CalculationMode.Price, this.valorStop);
//this.SetStopLoss(this.valorStop);
Comment
-
Hi. The values for stop loss:
this.valorStop = this.instanciaIndicador.getCloseActual() - 3;
Print("Valor Stop " + this.valorStop);
Print("Entrada Orden " + this.entrada);
this.ordenActual = this.EnterLongLimit(this.BarsInProgress, true, 200, this.entrada, "");
} else {
this.valorStop = this.instanciaIndicador.getCloseActual() + 3;
values for take profit:
private double calcularTakeProfit(int tendenciaActual) {
double close;
double toReturn;
close = this.instanciaIndicador.getCloseActual();
if (tendenciaActual == 1) {
toReturn = close + 1.25;
} else {
toReturn = close - 1.25;
}
Print ("Take Profit " + toReturn);
return toReturn;
Comment
-
Thanks, I don't think the issue is related to the code you use, please try manual orders and report back how this works out. If it does, then I would suggest adding a simple target and stop to the SampleMACrossOver and rechecking the order placement to the TWS paper account with this strategy.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
20 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
120 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
174 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
92 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
134 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|

Comment