Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
account position error
Collapse
X
-
Hello franatas,
This is likely an issue with the position update from Apex/Rithmic.
May I confirm you are updated to 8.1.1.7?
If so, please send an email to support [at] ninjatrader [dot] com so we may request your log and trace files and report to our development.Chelsea B.NinjaTrader Customer Service
-
You sent me to contact support by mail and I did so. unfortunately the only answer they gave me was to open a real account with ninja, that this happened because rithmic only gives some data by registered email, the truth is that I don't understand what this answer is due to.
The fact is that by having two apex accounts they resolved that it was like that and that's it, but now I'm with only one account, so this shouldn't happen but it does.
It is annoying that after closing an operation, it no longer opens until deactivating and reactivating the strategy, since the position that was opened at the beginning appears in the main panel of strategies and is not restored. could you help please, thank you
Comment
-
I think the code is correct
protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
{
if (execution.Order.OrderState == OrderState.Filled)
{
OrdenEntrada = null;
SumaRellenos = 0;
}
}
protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string nativeError)
{
AssignOrderToVariable(ref order);
if (OrdenEntrada != null && OrdenEntrada == order)
{
if (order.OrderState == OrderState.Cancelled || order.OrderState == OrderState.Rejected || order.OrderState == OrderState.Unknown)
{
OrdenEntrada = null;
SumaRellenos = 0;
}
}
}
Comment
-
Hello franatas,
The issue is not that the exit order was not submitted, the issue is that the position update from the brokerage does not show the position as closed on the Positions tab of the Control Center is this correct?
This is likely due to the instrument update coming out of order and causing unexpected behavior.
We would need to track these so that we can provide the information to the brokerage.
Do you have a case number from your email to our support so that I may check in with the technician that received your case?Chelsea B.NinjaTrader Customer Service
Comment
-
Originally posted by franatas View PostI think the code is correct
protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
{
if (execution.Order.OrderState == OrderState.Filled)
{
OrdenEntrada = null;
SumaRellenos = 0;
}
}
protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string nativeError)
{
AssignOrderToVariable(ref order);
if (OrdenEntrada != null && OrdenEntrada == order)
{
if (order.OrderState == OrderState.Cancelled || order.OrderState == OrderState.Rejected || order.OrderState == OrderState.Unknown)
{
OrdenEntrada = null;
SumaRellenos = 0;
}
}
}
protected override void OnExecutionUpdate(Execution execution, string executionId, double price,
int quantity, MarketPosition marketPosition, string orderId, DateTime time)
{
if (OrdenEntrada != null && OrdenEntrada == execution.Order && execution.Order.OrderState == OrderState.Filled)
{
OrdenEntrada = null;
SumaRellenos = 0;
}
}
Comment
-
I'm just testing it to avoid the error, I don't know if it will solve it, but the code passes EntryOrder to null and I imagine that it no longer takes the panel into account, let's see what happens
if (OrdenEntrada == null && DayOk)
en vez de
if (Position.MarketPosition == MarketPosition.Flat && DayOk )Last edited by franatas; 07-17-2023, 09:17 AM.
Comment
-
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by JGriff5646, Today, 10:02 PM
|
0 responses
5 views
0 likes
|
Last Post
by JGriff5646
Today, 10:02 PM
|
||
Started by AdamDJ8, Today, 09:18 PM
|
0 responses
3 views
0 likes
|
Last Post
by AdamDJ8
Today, 09:18 PM
|
||
Started by knowmad, Today, 03:52 AM
|
2 responses
29 views
0 likes
|
Last Post
by knowmad
Today, 09:03 PM
|
||
Started by ETFVoyageur, Today, 07:05 PM
|
0 responses
11 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:05 PM
|
||
Started by Orion815, 05-02-2024, 08:39 AM
|
2 responses
18 views
0 likes
|
Last Post
by Orion815
Today, 06:24 PM
|
Comment