Current location | Thread information | |
![]() ![]() ![]() ![]() ![]() ![]() |
Last Activity 7/6/2025 3:47 AM 10 replies, 3896 viewings |
|
|
Printer friendly version |
^ Top | |||
kmcintyre![]() Veteran ![]() ![]() Posts: 132 Joined: 9/12/2007 Location: Valley Center, CA ![]() |
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 ![]() ![]() ![]() Posts: 170 Joined: 12/29/2006 Location: Austin, Tx ![]() |
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 ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
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 ![]() ![]() ![]() Posts: 170 Joined: 12/29/2006 Location: Austin, Tx ![]() |
Jim, we are currently working on the feature list of 2021 so I will add this to it. Ryan | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
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 | |||
SteveL![]() Veteran ![]() ![]() Posts: 133 Joined: 2/15/2007 Location: Boulder, CO ![]() |
Hi, Ryan. So, what symbols are defined as constants, and valid for use, in HRS_DIFF(), other than "SPY"? | ||
^ Top | |||
Ryan Olson![]() Veteran ![]() ![]() ![]() Posts: 170 Joined: 12/29/2006 Location: Austin, Tx ![]() |
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 | ||
^ Top | |||
kmcintyre![]() Veteran ![]() ![]() Posts: 132 Joined: 9/12/2007 Location: Valley Center, CA ![]() |
Ryan Could you post an example script that includes the syntax for passing a Symbol into a #indicator as a constant? Thanks | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
You cannot pass strings into an OLang Indicator, System or Stop via a #param input. This has been requested many times but since Hans is gone now, I don't expect significant changes like that to be made to the OLang Parser for a very long time, if ever. A few of the canned Nirvana indicators accept string param's in their lists, surrounded by double-quotation marks. I haven't done it myself, but I suspect you could code a custom Indicator using the SDK that would accept strings. But of course there is zero support avail for SDK coding work. | ||
^ Top | |||
kmcintyre![]() Veteran ![]() ![]() Posts: 132 Joined: 9/12/2007 Location: Valley Center, CA ![]() |
I have used constants for decades, but neverr as a parameter variable. (Sounds like a contradiction to me...) I was really hoping to see the OL that allowed me to pass a string to a user defined OL function. Maybe Ryan can post something I can use in the future. Onward... . | ||
^ Top | |||
Vinay![]() Regular ![]() ![]() Posts: 70 Joined: 1/18/2012 Location: Planet Earth ![]() |
Originally written by Jim Dean on 8/11/2021 2:56 PM This has been requested many times but since Hans is gone now, I don't expect significant changes like that to be made to the OLang Parser for a very long time, if ever. It is very sad to note that Nirvana is losing its top talents one after another. Nirvana customers are staring at a very bleak future as far as future product development and support is concerned. [Edited by Vinay on 8/12/2021 1:31 AM] |
|
|
Legend | Action | Notification | |||
Administrator
Forum Moderator |
Registered User
Unregistered User |
![]() |
Toggle e-mail notification |