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 argusthome, 03-08-2026, 10:06 AM
|
0 responses
95 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
49 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
31 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
35 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
72 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment