Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Three questions about SetParabolicStop (running in realtime)
Collapse
X
-
Hi Mark, the SetParabolicStop() code is not available but it does work similarly to the ParabolicSAR that is available to view in the Indicators folder.
Kind regards,
-ChrisL
-
Hi Mark, Unfortunately, It is not possible. This is noted in the SetParabolicStop documentation:
Should you have multiple Bars objects of the same instrument while using SetParabolicStop() in your strategy, you should only submit orders for this instrument to the first Bars context of that instrument. This is to ensure your order logic is processed correctly and any necessary order amendments are done properly.
Leave a comment:
-
I suppose it's not possible to use the SetParabolicStop order based on a different dataseries?
Leave a comment:
-
Hi Mark,
For 1. There is no way to exit a portion of a position with one set of stops and targets. You first need to call EnterLong twice with unique signal names and target each order with its own SetParabolicStop/SetProfitTarget method e.g. in pseudocode
Code:EntriesPerDirection = 2; //in State.SetDefaults ... SetParabolicStop("LE0", ...); SetProfitTarget("LE0", ...); EnterLong(1, "LE0"); SetParabolicStop("LE1", ...); SetProfitTarget("LE1", ...); EnterLong(1, "LE1");
Leave a comment:
-
Thanks Chris. I'm good with question 3. Minor clarifications on 1 and 2 please:
1. So for SetParabolicStop("LE", CalculationMode.Ticks, 10, true, 0.03, 0.3, 0.01); if "LE" originally had 2 orders and now has 1 for whatever reason, then calling the same code again: SetParabolicStop("LE", CalculationMode.Ticks, 10, true, 0.03, 0.3, 0.01); will now replace the existing 2 parabolic stops with a single one, correct? Because the syntax does not appear to offer a way to call SetParabolic... With an order quantity.
SetParabolicStop(CalculationMode mode, double value)
SetParabolicStop(stringfromEntrySignal,CalculationModemode,doublevalue,boolisSimulatedStop,doubleacceleration,doubleaccelerationMax,doubleaccelerationStep)
2. So then the only way for item 2 would be to monitor price via onMarketUpdate and fire a market order to exit when marketUpdate.last = some value
Thanks!
Leave a comment:
-
-
Hello, thanks for writing in.
1. To modify the orders made with Set methods, you must call the same method again with the updated parameters, keeping the same "FromEntrySignal".
2. You can not use Exit orders and Set orders at the same time. See the order handling rules here:
https://ninjatrader.com/support/help...rnalOrderHandl ingRulesThatReduceUnwantedPositions
"Set() methods that generate orders to exit a position will be ignored if:
•A position is open and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction
•A position is open and an order submitted by a non market order exit method (ExitLongLimit() for example) is active"
3. I will test this on my end and see what happens when isSimulatedStop is enabled.
Leave a comment:
-
Three questions about SetParabolicStop (running in realtime)
1. I'd like to change the quantity of stops much like I can do with a stop order in ChangeOrder like so:
ChangeOrder(stopOrder, stopOrder.Quantity-1, 0, Position.AveragePrice);
2. My target orders were working fine until I added some logic in OnExecutionUpdate to use SetParabolicStop as follows:
if(useTrailStop) // set as a boolean parameter at startupSetParabolicStop("SE", CalculationMode.Ticks, 10, true, 0.03, 0.3, 0.01);
else stopOrder = ExitShortStopMarket(0, true, execution.Order.Filled, execution.Order.AverageFillPrice + stopLoss * TickSize, "SS", "SE");
if (!tpSet){targetOrder = ExitShortLimit(0, true, execution.Order.Filled-1, execution.Order.AverageFillPrice - takeProfit * TickSize, "ST", "SE");
tpSet = true; // only set 1 takeProfit order. Second one moved to BE and trailed
chasePrice = execution.Order.AverageFillPrice - takeProfit * TickSize;
}
... Suddenly target orders are not being set any longer. Logs show they are being submitted but I'm not seeing any news on why they're not being accepted. Documentation says one can't combine stop orders and parabolic orders for the same position but I wouldn't think that also refers to target orders, does it?
3. In the logs, the Parabolic Stops are working fine but the insist on not being MarketifTouched. See image from log. Does not matter if they are simulated stops or not.
Many thanks for your time.
Mark
1 PhotoLast edited by markdshark; 03-29-2023, 12:46 PM.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by xfactscout, Today, 02:26 PM
|
1 response
3 views
0 likes
|
Last Post
|
||
Started by SheriDi, Today, 02:24 PM
|
1 response
15 views
0 likes
|
Last Post
![]()
by SheriDi
Today, 03:01 PM
|
||
Started by sofortune, Today, 02:41 PM
|
1 response
4 views
0 likes
|
Last Post
|
||
Started by xfactscout, Today, 02:43 PM
|
0 responses
4 views
0 likes
|
Last Post
![]()
by xfactscout
Today, 02:43 PM
|
||
Started by BodhiKarma, Today, 01:08 PM
|
3 responses
16 views
0 likes
|
Last Post
|
Leave a comment: