OmniTrader Forum OmniTrader Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


  Current location        Thread information  
OmniTrader Upgrade Forums
Trade Plans
troubles with limit take profit stop
Last Activity 1/2/2025 4:50 PM
5 replies, 1006 viewings

Jump to page : 1
Now viewing page 1 [25 messages per page]
 
back reply
Printer friendly version

^ Top
kmcintyre

Legend
100100100100
Posts: 410

Joined: 8/30/2007
Location: Valley Center, CA

User Profile
 
Subject : troubles with limit take profit stop
Posted : 5/26/2019 11:50 AM
Post #46207

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
20001000
Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: troubles with limit take profit stop
Posted : 5/26/2019 12:45 PM
Post #46209 - In reply to #46207

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
100100100100
Posts: 410

Joined: 8/30/2007
Location: Valley Center, CA

User Profile
 
Subject : RE: troubles with limit take profit stop
Posted : 5/26/2019 9:22 PM
Post #46211 - In reply to #46207

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
20001000
Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: troubles with limit take profit stop
Posted : 5/27/2019 12:40 AM
Post #46213 - In reply to #46211

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
100100100100
Posts: 410

Joined: 8/30/2007
Location: Valley Center, CA

User Profile
 
Subject : RE: troubles with limit take profit stop
Posted : 5/27/2019 1:10 PM
Post #46214 - In reply to #46207

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
20001000
Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: troubles with limit take profit stop
Posted : 5/27/2019 2:31 PM
Post #46216 - In reply to #46214

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]

Jump to page : 1
Now viewing page 1 [25 messages per page]
back reply

Legend    Action      Notification  
Administrator
Forum Moderator
Registered User
Unregistered User
E-Mail this thread to a friend
Toggle e-mail notification


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.