Programmatic Support and Resistance for Thinkorswim

rad14733

rad14733

Well-known member
VIP
@joshua74133 There should be an error or list of errors at the bottom of the editor panel... What do those errors say...??? The only way to learn Thinkscript is to start learning... We may not always be here to help solve simple problems...
 
rad14733

rad14733

Well-known member
VIP
@rad14733 Syntax error: An 'else' block expected at 54:17 is what it says.
Ok... So your "if...then...else" clause is missing the "else" part in or around line 54... The line number denotes that the error started in line 54, or before...
 
rad14733

rad14733

Well-known member
VIP
still lost ive replaced and put it every which way
I'm trying to get you to learn rather than me doing all the work and just handing you answers... You need to break things down into more statements... You are trying to use "condition" in the same statement that it is being created in... Create "condition" variable and then use it in the next line rather than the flawed way you have it... So your error isn't specific due to your goofy-footed coding attempt... Parsers are only so smart... You can do this...

Code:
def condition = if open is equal to topline and RSI > over_Bought then AssignPriceColor(if condition then Color.GREEN else Color.CURRENT);
 
J

joshua74133

Member
VIP
went a different route with the script
AssignBackgroundColor( if open is equal to topline and RSI > over_Bought
then Color. blue
else Color.CURRENT);

Alert(RSI > over_Bought, " ", Alert.Bar, Sound.Bell);
 

Similar threads

Top