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
OmniLanguage Discussion
String #PARAMs
Last Activity 10/12/2020 10:22 AM
6 replies, 112 viewings

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

^ Top
kmcintyre

Veteran
100
Posts: 115

Joined: 9/12/2007
Location: Valley Center, CA

User Profile
 
Subject : String #PARAMs
Posted : 10/11/2020 8:33 PM
Post #31263

I noticed that Ed had a #indicator that accepted a String as a #PARAM.

I have not been able to get Strings to work as #PARAMs.

Does anyone know the syntax required for String #PARAMs?

Thanks

^ Top
Ryan Olson

Veteran
1002525
Posts: 155

Joined: 12/29/2006
Location: Austin, Tx

User Profile
 
Subject : RE: String #PARAMs
Posted : 10/12/2020 9:40 AM
Post #31265 - In reply to #31263


Hey Keith,

I assume you are talking about his HRS seminars.

Const RefSymbol as String = "SPY"

This is using the Const statement which declares a constant and sets its value. So later in the code you see where Ed uses HRSDiff = HRS_DIFF(14,3,RefSymbol).

This assigns the value of HRSDiff to HRS_Diff(14, 3, "SPY"). Since HRS_Diff allows to pass the following "Periods", SMAPeriods", and RefSymbol - Ed assigned a constant value to RefSymbol and set it to SPY.

If this wouldn't have been set to a constant "const" then the value would have been the symbol you are currently on.

Not every system or indicator would allow you to set the const of a value.

Here is a site you can look at to get more information about Constants.
https://docs.microsoft.com/en-us/office/vba/language/concepts/getting-started/declaring-constants#:~:text=You%20use%20the%20Const%20statement,constant%20and%20set%20its%20value.&text=You%20can%20declare%20a%20constant,statement%20with%20the%20Public%20keyword.

Hope this helps,

Ryan Olson
Nirvana Systems
^ Top
Jim Dean

Sage
20001000100100100
Posts: 3313

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

User Profile
 
Subject : RE: String #PARAMs
Posted : 10/12/2020 10:06 AM
Post #31266 - In reply to #31265

Thanks Ryan

In any OLang Stop, System or Indicator a user can declare String variables, then assign values to them in the code, and manipulate those values with VBA functions like left(), right(), instring() etc ... or concatenate them using &

What we CANNOT do, to the best of my knowledge, is INPUT a string variable via the #param command ... or for that matter, OUTPUT a string variable via the Return statement.

Of the two, probably an expanded #param command would be the most useful to OLang programmers ... that is, maybe something like this:

#paramStr "NameOfStringParam", "DefaultStringValue", "List,Of,Other,Standard,Values,For,A,Dropdown,Box"

Please add that to the enhancements list ... it would be really helpful!

Thanks
^ Top
Ryan Olson

Veteran
1002525
Posts: 155

Joined: 12/29/2006
Location: Austin, Tx

User Profile
 
Subject : RE: String #PARAMs
Posted : 10/12/2020 10:07 AM
Post #31267 - In reply to #31263



Jim, we are currently working on the feature list of 2021 so I will add this to it.

Ryan
^ Top
Jim Dean

Sage
20001000100100100
Posts: 3313

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

User Profile
 
Subject : RE: String #PARAMs
Posted : 10/12/2020 10:18 AM
Post #31268 - In reply to #31267

Thanks, Ryan.

Please ALSO add OLang related requests:

1. Return values use DOUBLE precision ... crucial for Forex support!

2. Plot command Width param's allow negatives, where -5 = displayed candle width (thus -1 to -10 widths would auto-scale with #bars displayed, while +1 to +10 would work as they do now)

3. Plot command new param to specify Style of line (dot, dash, solid etc)

... my guess is that those above should all be pretty straightforward to add to the parser ... fingers crossed!

4. Make ALL canned and plugin Nirvana functions (MACD, STO, etc) use Double Precision calcs instead of Single, including their Return values. Crucial for Forex support!

... that actually should be pretty simple to do, but a bit time-consuming ... it presumes that #1 above has already been implemented.

Thanks!


[Edited by Jim Dean on 10/12/2020 10:20 AM]

^ Top
Steve Luerman

Veteran
100
Posts: 122

Joined: 2/15/2007
Location: Boulder, CO

User Profile
 
Subject : RE: String #PARAMs
Posted : 10/12/2020 10:21 AM
Post #31269 - In reply to #31265

Hi, Ryan.
So, what symbols are defined as constants, and valid for use, in HRS_DIFF(), other than "SPY"?
^ Top
Ryan Olson

Veteran
1002525
Posts: 155

Joined: 12/29/2006
Location: Austin, Tx

User Profile
 
Subject : RE: String #PARAMs
Posted : 10/12/2020 10:22 AM
Post #31270 - In reply to #31263



You can use any symbol you want in this case. AAPL, SPY, TSLA whatever you like. It will be using that symbol for that calculation.

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