OmniTrader Professional Forum OmniTrader Professional 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 Professional Forum
OmniScripts
Fixed loss stop based on purchase price
Last Activity 12/22/2017 12:33 AM
10 replies, 741 viewings

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

^ Top
Colin Card

Member

Posts: 19

Joined: 7/23/2006

User Profile
 
Subject : Fixed loss stop based on purchase price
Posted : 10/31/2015 6:17 PM
Post #24707

I have a few strategies that work very well with new (or close to new) Buy signals because the Fixed Loss Stop available is based on the price when the Buy signal is first triggered.

However the strategies also track and post ongoing Buy signals as the criteria are met so it is possible to use these as Buys for a symbol that has been 'in trade' for some time - to either open a trade or add to an existing one.

The problem is that the Nirvana FLS that the strategy uses is based on the price at the original Buy signal whereas it needs to be based on the price at the point of purchase. Does anyone know how to (a) set Nirvana's FLS so it uses the actual purchase price or (b) how to identify the actual purchase price (HLCO on the day could be used) to be used in a script for one's own FLS?

Colin
^ Top
THOMAS HELGET

Legend
500
Posts: 500

Joined: 3/22/2006
Location: BALDWINSVILLE, NEW YORK

User Profile
 
Subject : RE: Fixed loss stop based on purchase price
Posted : 10/31/2015 7:50 PM
Post #24709 - In reply to #24707

Colin:

I think you should be able to access Jim Dean's TradeTight Forum here for the answer to your probem:

http://tradetight.org/forums/thread-view.asp?tid=463&posts=2&highlight=FIXED%20LOSS%20STOP&highlightmode=1#M3632

Look at the code about 20% down and you will see Case 1 (which you can select) 'based on actual Entry Price.

I hope that is what you want.

Tom Helget
^ Top
Colin Card

Member

Posts: 19

Joined: 7/23/2006

User Profile
 
Subject : RE: Fixed loss stop based on purchase price
Posted : 11/1/2015 12:26 PM
Post #24710 - In reply to #24707

Thanks Tom, looks as if this might be what I need. Seems it might be useful to join Jim's forum if that is possible.

Colin
^ Top
THOMAS HELGET

Legend
500
Posts: 500

Joined: 3/22/2006
Location: BALDWINSVILLE, NEW YORK

User Profile
 
Subject : RE: Fixed loss stop based on purchase price
Posted : 11/1/2015 2:21 PM
Post #24711 - In reply to #24710

Colin:

Yes, I think so.

By the way, I did have a little problem with my download that caused my OT to crash.

I got an Invalid Token indication when I compiled Jim's OmniScript and usually that means that there is a Line Return at the end of the script that has to be removed. I thought I had but still had problems. And, things came up - you know how it is. I am going to try later to see if I can get it to compile.

So, don't do anything with it if you have obtained it until I can tell you how to safely implement it in OT.

Tom Helget
^ Top
THOMAS HELGET

Legend
500
Posts: 500

Joined: 3/22/2006
Location: BALDWINSVILLE, NEW YORK

User Profile
 
Subject : RE: Fixed loss stop based on purchase price
Posted : 11/1/2015 2:40 PM
Post #24712 - In reply to #24711

Colin:

Yeah that must have been it.

Whenever you download a file and transfer it to one of your VBA folders it is always a wise idea to Edit... OmniLanguage... and find the newly imported file before doing anything else.

Go to the very last printed line and hold down the Delete key until the last line number disappears and the line you are on is the last line in the script. Then perform a Build...Compile All Projects just to make sure. If everything is fine you are good to go.

If not OT might start up with bizarre error messages and really louse up things like Color Charts that you have created. So if anything seems amiss in the compile above delete the imported file before it gives you a real headache.

Really maybe the best way to do things from the get-go is to Edit...OmniLanguage and then File....New... and select the file type you are going to copy. It is a Stop in this case. Enter the exact same name of the file that you have downloaded in the Function Name Dialog Box to keep things straight. Then open the text file that you downloaded. Copy all the script and Paste it in the blank space in the OmniLanguage editor. You may have to remove the extra "#Stop" that was generated when you created the file.

Tom Helget

[Edited by THOMAS HELGET on 11/1/2015 2:47 PM]

^ Top
Jim Dean

Sage
20001000100
Posts: 3108

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Fixed loss stop based on purchase price
Posted : 11/1/2015 2:43 PM
Post #24713 - In reply to #24712

Or, simply copy and paste it into the OLang editor pane. Extra chars get auto-stripped.
^ Top
THOMAS HELGET

Legend
500
Posts: 500

Joined: 3/22/2006
Location: BALDWINSVILLE, NEW YORK

User Profile
 
Subject : RE: Fixed loss stop based on purchase price
Posted : 11/1/2015 2:47 PM
Post #24714 - In reply to #24713

Jim:

Ha, I was just adding that in some detail when you jumped in.

Tom Helget
^ Top
Colin Card

Member

Posts: 19

Joined: 7/23/2006

User Profile
 
Subject : RE: Fixed loss stop based on purchase price
Posted : 11/1/2015 2:50 PM
Post #24715 - In reply to #24707

Thanks Tom, advice much appreciated.

I always like to use code that I understand so I shall be studying Jim's codes (I printed the entire page) before actually using them. Also I cannot download the attachments - I guess you have to be a member of Jim's club to do that. So I would have to retype from the printout.

What I will most likely do initially is to incorporate the 'purchase price' into my FLS based on Jim's code. If that works out I can justify the time to implement more of what Jim has in his script. I find the notes for OmniLanguage are a bit thin - you would expect that people would want to be able to access and use their purchase price rather than the OCHL of the day that the Buy signal was originally triggered.

Thanks again for your help.

Colin
^ Top
THOMAS HELGET

Legend
500
Posts: 500

Joined: 3/22/2006
Location: BALDWINSVILLE, NEW YORK

User Profile
 
Subject : RE: Fixed loss stop based on purchase price
Posted : 11/1/2015 3:06 PM
Post #24716 - In reply to #24715

Colin:

While it is true that Jim's comments are a bit thin in this example I looked at it myself and I am always amazed at the directness and simplicity of Jim's code. It is like watching the paint dry to a crisp alluring image on a da Vinci.

Tom Helget
^ Top
Jim Dean

Sage
20001000100
Posts: 3108

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Fixed loss stop based on purchase price
Posted : 11/1/2015 3:09 PM
Post #24717 - In reply to #24716

Van Gogh, please.

FYI - don't need to become a "member". Just email me contact info to get registered. No fee.
^ Top
Colin Card

Member

Posts: 19

Joined: 7/23/2006

User Profile
 
Subject : RE: Fixed loss stop based on purchase price
Posted : 11/2/2015 12:26 PM
Post #24721 - In reply to #24707

Thank you Jim. Colin.Card@shaw.ca.

Incidentally, my comment on OmniLanguage description being a bit thin was not referencing your code but Nirvana's documentation. I find some aspects that I would consider important appear to have no references: the case in point is how do you incorporate the pricing on the day you actually make a trade into your strategy stops? I also find that the plotting routines are a bit finicky: they often seem to plot the default values in a stop rather than the values determined by dynamic optimization.

I think that a webinar course by Nirvana on the use of OmniLanguage would be very useful.

Colin
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.