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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
72 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
39 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment