Current location | Thread information | |
![]() ![]() ![]() ![]() ![]() ![]() |
Last Activity 1/2/2025 4:50 PM 5 replies, 1006 viewings |
|
|
Printer friendly version |
^ Top | |||
kmcintyre![]() Legend ![]() ![]() ![]() ![]() Posts: 410 Joined: 8/30/2007 Location: Valley Center, CA ![]() |
I have an OL #stop that sets ExitLevel to the price I want my trade plan to take profits at. In my trade plan I have a condition that has my OL stop enabled. So far so good, except the stop is not exiting the position. Which brings me to the Orders pane of my trade plan. I have - Sell 100& Limit GTC selected in the top line. In the second line I have - 0 Points Above Last 14 (for ATR Periods which is NA) and 5 for TIF (which is the default and I don't think really applies...) What I want to happen is the ExitLevel specified in my #stop to be the Limit price, and for the TP to Sell 100% when the Last price = Exit Price. So what am I missing? I have mucked around with this for too long. Obviously I am missing something... Ideas? An example of a known good stop and TP that implements a Limit Take Profit order would be killer! Thanks | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() Posts: 3022 Joined: 9/21/2006 Location: L'ville, GA ![]() |
Hi, Keith You've hit upon a snag that I've posted a lot about, over the past several years. It appears that "virtual" Limit & SL stops (ie with Level set within OLang Condition code) are unreliable &/or unpredictable &/or just plain don't work ... matter of opinion, and YMMV. OTOH, afaik, if you set the level purely based on the menu-options on the Orders pane, and just use the OLang to return true/false to trigger the order when/if you want, that is much more reliable ... but of course those Order pane menus are somewhat restrictive re choosing the basis for the level. Re PdsInForce ... Barry has provided explanations repeatedly over the years, but I've not grown any confidence in using it. So, at least for testing, I'd suggest you leave it set for zero (ie no fixed duration). Hope this helps ... please post about what you find that *does* work reliably. | ||
^ Top | |||
kmcintyre![]() Legend ![]() ![]() ![]() ![]() Posts: 410 Joined: 8/30/2007 Location: Valley Center, CA ![]() |
I have a Virtual Level Stop Market order working fine. A Virtual Level Limit order does not work at all. The price bangs through the limit price (set via ExitLevel = … in my OL code) but the Trade Plan does not exit the position. If I monitor the Limit in my #stop and execute Signal = ExitSignal when price exceeds my limit, the trade is closed but at the open of the next bar. The Virtual Level is not honored. So limit orders appear to be unavailable for simulation. This is really limiting! (pun intended...) I will call Nirvana Tech Support on Tuesday and try to be a squeaky wheel. Thanks JD. | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() Posts: 3022 Joined: 9/21/2006 Location: L'ville, GA ![]() |
Yup that squares with my experience. Virtual SM (which I don’t mention in my prior post, intentionally) seems to work OK most of the time. Here’s something to try - I think I heard it from Barry a while back, but I don’t recall whether or how much I tested it. There might be another reserved word in OL called “ProfitLevel” which maaaybe can be used toset the virtual limit threshold (ie Signal=ProfitLevel)) Or, it may be that I’m remembering simply a request that they add such a variable ;-) | ||
^ Top | |||
kmcintyre![]() Legend ![]() ![]() ![]() ![]() Posts: 410 Joined: 8/30/2007 Location: Valley Center, CA ![]() |
I tried ProfitLevel = (like ExitLevel = + and Signal = ProfittLevel but neither would compile. It makes sense that there would be a different keyword for Limit virtual levels versus Sopt virtual levels because BOTH can exist in one trade plan. I really don't see how one keyword could work for both. Unfortunately N does not provide a lot of documentation or example code. The stops provided with various plugins are sans source, so no help there. Hopefully Nirvana Tech Support will clarify things quickly. Cheers | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() Posts: 3022 Joined: 9/21/2006 Location: L'ville, GA ![]() |
I must have been remembering my “suggested” key word. Will you be able to use the order tab menu options as a close-enuf alternative? Note: it’s a hassle but you can set up multiple variants of the order tab setting, each attached to a Condition - but be SURE that the Condition only is true for one of the variants at a time. That is, hardcode an OLang Indicator (not stop) to match the alternative settings, controlled by internal logic or by a param, and OUTPUT an integer to Match the Order Pane choice you want to use. Then, use the OmniScript Condition option to call the Indic and test if it’s equal to the integer-label for that Order type. Problem of this might be that a typical Indic doesn’t know if signal is long or short, nor does it know the entryprice (like a Stop would). But, it does have a Return value. Only way around this is to create a true Stradicator (see TradeTight forum) - but that’s a huge coding task. Advantage to this is that using the order tab method allows you to make it a Broker stop if you want. And that you can use it with any order type (afaik). [Edited by Jim Dean on 5/27/2019 2:32 PM] |
|
|
Legend | Action | Notification | |||
Administrator
Forum Moderator |
Registered User
Unregistered User |
![]() |
Toggle e-mail notification |