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 DannyP96, 05-18-2026, 02:38 PM
|
1 response
27 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
117 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
69 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
226 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
418 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|

Comment