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.


Only Forum Moderators, Administrators, and the owner of this message may delete it.

 
Ryan Olson

Veteran
1002525
Posts: 170

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
Deleting message 31265 : RE: String #PARAMs


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