Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
atm orderid does not exist
Collapse
X
-
Originally posted by NinjaTrader_Bertrand View PostMrTicks, I'm not sure I follow you, did you follow Josh's prior advise to only check this only after the Atm strategy template is working and managing the NS strategy exits? Otherwise it would not make sense to check for this...
Even when I run the SampleATMStrategy I get errors in my log file. The errors appear when I start the strat and then repeat every minute.
Here is an example of the errors:
GetAtmStrategyMarketPosition() method error: AtmStrategyId '5b7ae731ae74427cb3619d916e7ee0d1' does not exist GetAtmStrategyEntryOrderStatus() method error: orderId '17e5b3d0813043f2be4f85735246c1b1' does not exist
What code should be present in order to prevent those errors?
Comment
-
If you run our SampleAtm one for testing, do you have the needed 'AtmStrategyTemplate' created beforehand in the DOM so this could be called?
If I run the sample here on my end on a ES 1 min chart I do not get the issues you mentioned, please recheck with the correct template to call available.BertrandNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Bertrand View PostIf you run our SampleAtm one for testing, do you have the needed 'AtmStrategyTemplate' created beforehand in the DOM so this could be called?
If I run the sample here on my end on a ES 1 min chart I do not get the issues you mentioned, please recheck with the correct template to call available.
I do have an ATM template that I created to match the name of the one in the SampleATMStrategy. I think I know why I get those errors, I was running the same strat on multiple instruments all calling the same ATM template with CalculateOnBar close set to false.
When I just run one strat I don't get the errors.
Comment
-
Originally posted by NinjaTrader_Bertrand View PostIf you run our SampleAtm one for testing, do you have the needed 'AtmStrategyTemplate' created beforehand in the DOM so this could be called?
If I run the sample here on my end on a ES 1 min chart I do not get the issues you mentioned, please recheck with the correct template to call available.
As opposed to the SampleATM strat that only has one entry condition called against the last bar.
Comment
-
Originally posted by NinjaTrader_Josh View PostMrTicks,
If you have 4 ATMs then I suggest ensuring you only try to access ones that are actually active. You could try using separate variables to track each one individually too.
I had this:
Code:// Condition set 1 if (orderId.Length == 0 && atmStrategyId.Length == 0 && (blah(blah)[0] > 0)) { atmStrategyId = GetAtmStrategyUniqueId(); orderId = GetAtmStrategyUniqueId(); AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.StopLimit, High[0] + PrevBarPlusTicks * TickSize, 0, TimeInForce.Day, orderId, "ATM1", atmStrategyId); } // Condition set 2 if (orderId.Length == 0 && atmStrategyId.Length == 0 && (blah(blah)[1] > 0)) { atmStrategyId = GetAtmStrategyUniqueId(); orderId = GetAtmStrategyUniqueId(); AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.StopLimit, High[1] + PrevBarPlusTicks * TickSize, 0, TimeInForce.Day, orderId, "ATM2", atmStrategyId); }
Code:{ atmStrategyId2 = GetAtmStrategyUniqueId(); orderId2 = GetAtmStrategyUniqueId(); AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.StopLimit, High[1] + PrevBarPlusTicks * TickSize, 0, TimeInForce.Day, orderId2, "ATM2", atmStrategyId); }
Comment
-
Should the sample ATM strat be able to run on tick charts without any errors? When I run it on tick charts I get the same "does not exist errors".
e.g.,
**NT** GetAtmStrategyEntryOrderStatus() method error: orderId '0f3f39377edd4e3bb4ddafcf6808de86' does not exist
**NT** GetAtmStrategyMarketPosition() method error: AtmStrategyId '09776050a0884200b69f5090437f6e10' does not exist
**NT** GetAtmStrategyMarketPosition() method error: AtmStrategyId '09776050a0884200b69f5090437f6e10' does not exist
The current ATM Strategy market position is: Flat
**NT** GetAtmStrategyPositionQuantity() method error: AtmStrategyId '09776050a0884200b69f5090437f6e10' does not exist
The current ATM Strategy position quantity is: 0
**NT** GetAtmStrategyPositionAveragePrice() method error: AtmStrategyId '09776050a0884200b69f5090437f6e10' does not exist
The current ATM Strategy average price is: 0
**NT** GetAtmStrategyUnrealizedProfitLoss() method error: AtmStrategyId '09776050a0884200b69f5090437f6e10' does not exist
The current ATM Strategy Unrealized PnL is: 0
**NT** GetAtmStrategyEntryOrderStatus() method error: orderId 'd2ffd88494194c0f81172c6c7bdd734a' does not exist
**NT** GetAtmStrategyEntryOrderStatus() method error: orderId 'f85d453ef084466eb05160778f1a4530' does not exist
**NT** GetAtmStrategyEntryOrderStatus() method error: orderId '1ca9a73135714f9e8db6245ab89096e6' does not exist
**NT** GetAtmStrategyEntryOrderStatus() method error: orderId '0f3f39377edd4e3bb4ddafcf6808de86' does not exist
Comment
-
Have version 7.0.0.17 .
I went into the sampleATM strat and then right clicked and went save as. Then renamed it to a different one and replaced the original entry signals with my own. Then I renamed the ATM template it calls to one of my own.
Could it be because I have calculate on bar close set to false? In my strats that's the only difference?
PHP Code:protected override void Initialize()
{
CalculateOnBarClose = false;
}
Comment
-
There is one more difference and it's my ATM strategy create order when the signal is met.
The sample has a limit order but I have a stop limit order attached.
PHP Code:
//AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Limit, Low{0], 0, TimeInForce.Day, orderId, "TFL3BR230610ATM200T", atmStrategyId);
AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.StopLimit, High[0] + PrevBarsPlusTicks * TickSize, 0, TimeInForce.Day, orderId, "TFL3BR230610ATM200T", atmStrategyId);
}
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by geddyisodin, 04-25-2024, 05:20 AM
|
8 responses
58 views
0 likes
|
Last Post Yesterday, 10:45 AM | ||
Started by jxs_xrj, 01-12-2020, 09:49 AM
|
4 responses
3,285 views
1 like
|
Last Post
by jgualdronc
Today, 10:02 AM
|
||
Can someone turn this thinkscript into a ninjascript. 5PM CST OHL and Previous Day
by Option Whisperer
Started by Option Whisperer, Today, 09:55 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 09:55 AM | ||
Started by halgo_boulder, 04-20-2024, 08:44 AM
|
2 responses
22 views
0 likes
|
Last Post Today, 09:41 AM | ||
Started by mishhh, 05-25-2010, 08:54 AM
|
19 responses
6,189 views
0 likes
|
Last Post
by rene69851
Today, 09:29 AM
|
Comment