i am trying to implement different behaviors of the script depending on the current symbol that is opened, how do i check the name of the symbol?
for example (pseudocode):
if the symbol is CADJPY - do this
else if the symbol is NAS100USD - do this
i am trying to implement different behaviors of the script depending on the current symbol that is opened, how do i check the name of the symbol?
for example (pseudocode):
if the symbol is CADJPY - do this
else if the symbol is NAS100USD - do this
You can use syminfo.ticker to get the symbol name without exchange prefix e.g. MSFT, or syminfo.tickerid to get the symbol name with exchange prefix e.g. NASDAQ:MSFT.