Splitting words in a variable

 

Hi

wonder if anyone can help with this :

I have an indicator with a variable that returns a 2 word result

la_99 can be (depending on what the indicator returns

EMA Bullish, EMA Bearish, SMA Bullish or SMA Bearish. If I put Print (la_99) in the code and compile it puts whatever the variable is into the terminal. So I know that works .

Im trying to split the words into seperate variables.

Ive done this

if (la_99 == "EMA Bearish") la_100 = ("Bearish") ;else
if (la_99 == "EMA Bullish") la_100 =("Bullish");else
if (la_99 == "SMA Bearish") la_100 = ("Bearish");else
if (la_99 == "SMA Bullish") la_100 = ("Bullish");else

if (la_99 == "EMA Bearish") la_101 = ("EMA");else
if (la_99 == "EMA Bullish") la_101=("EMA");else
if (la_99 == "SMA Bearish") la_101 = ("SMA");else
if (la_99 == "SMA Bullish") la_101=("SMA");

But when I do Print (la_100); and (Print la_101);

All I get is an empty result.

Any help appreciated

Thanks

 
 
GlasgowR:

Hi

wonder if anyone can help with this :

I have an indicator with a variable that returns a 2 word result

la_99 can be (depending on what the indicator returns

EMA Bullish, EMA Bearish, SMA Bullish or SMA Bearish. If I put Print (la_99) in the code and compile it puts whatever the variable is into the terminal. So I know that works .

Im trying to split the words into seperate variables.

Ive done this

if (la_99 == "EMA Bearish") la_100 = ("Bearish") ;else
if (la_99 == "EMA Bullish") la_100 =("Bullish");else
if (la_99 == "SMA Bearish") la_100 = ("Bearish");else
if (la_99 == "SMA Bullish") la_100 = ("Bullish");else

if (la_99 == "EMA Bearish") la_101 = ("EMA");else
if (la_99 == "EMA Bullish") la_101=("EMA");else
if (la_99 == "SMA Bearish") la_101 = ("SMA");else
if (la_99 == "SMA Bullish") la_101=("SMA");

But when I do Print (la_100); and (Print la_101);

All I get is an empty result.

Any help appreciated

Thanks





Use SRC button to post your source code

.

I think you have here a decompiled indicator. if so then it is most likely not from author of the indicator

Use the original source code for posting and don't ask for help for decompiled software...

To me it looks not normal in code parameters like la_99, la_100, and la_101

if all you get is an empty result then we only can say

la_99 is not "EMA Bearish", not "EMA Bullish", not "SMA Bearish" and not "SMA Bullish"

Reason: