Hi guys, started to program from yesterday, just went through basics in learning center and now stucked.
My first goal is create column in watchlist to show "10" for tickers after 2 conditions are met (range of previous candle more then 10% up and current price is just above 50% level of previous day) else show 0..errors which tos highlighted me are in bold: (looks like I wrongly defined open and close of the day, probably DAY parameter I cant use like this?..Also what is the definition of last price? I found it like 'price', but looks like its not..and about error below, I have no idea....Many thanx for any help...
btw. what resources yo use to study?
def opicka= open(DAY)[1];
def zachodik= close(DAY)[1];
#calculate 50% of candle
def midik= (opicka+zachodik)/2;
#measure range of yesterday
def rangik=(close-open)/open*100;
#compare last price with midcandle
def porovnavacka= (price/midik-1)*100;
#3 conditions
def condition1 = porovnavacka > 0;
def condition2 = porovnavacka < 3;
def condition3 = rangik > 10;
def totalik = condition1+condition2+condition3;
def pravda =10;
def loz=0;
#if all 3 conditions are true then show 10 else 0
def vysledok= If (totalik=0,pravda,loz);
plot vysledok;
**************************************
No such parameter: totalik at 23:15
No default value for parameter 'condition' on if at 23:15
Identifier Already Used: vysledok at 24:6
Expected class com.devexperts.tos.thinkscript.data.SymbolType at 2:13
Expected class com.devexperts.tos.thinkscript.data.SymbolType at 3:15
Expected double
No such variable: DAY at 2:18
No such variable: DAY at 3:21
No such variable: price at 12:20
My first goal is create column in watchlist to show "10" for tickers after 2 conditions are met (range of previous candle more then 10% up and current price is just above 50% level of previous day) else show 0..errors which tos highlighted me are in bold: (looks like I wrongly defined open and close of the day, probably DAY parameter I cant use like this?..Also what is the definition of last price? I found it like 'price', but looks like its not..and about error below, I have no idea....Many thanx for any help...
btw. what resources yo use to study?
def opicka= open(DAY)[1];
def zachodik= close(DAY)[1];
#calculate 50% of candle
def midik= (opicka+zachodik)/2;
#measure range of yesterday
def rangik=(close-open)/open*100;
#compare last price with midcandle
def porovnavacka= (price/midik-1)*100;
#3 conditions
def condition1 = porovnavacka > 0;
def condition2 = porovnavacka < 3;
def condition3 = rangik > 10;
def totalik = condition1+condition2+condition3;
def pravda =10;
def loz=0;
#if all 3 conditions are true then show 10 else 0
def vysledok= If (totalik=0,pravda,loz);
plot vysledok;
**************************************
No such parameter: totalik at 23:15
No default value for parameter 'condition' on if at 23:15
Identifier Already Used: vysledok at 24:6
Expected class com.devexperts.tos.thinkscript.data.SymbolType at 2:13
Expected class com.devexperts.tos.thinkscript.data.SymbolType at 3:15
Expected double
No such variable: DAY at 2:18
No such variable: DAY at 3:21
No such variable: price at 12:20