berodney
New member
Hi all,
Looking to do something like this:
But the lowpoint, hightpoint, shortpoint etc. aren't being recognized, Can you not use if statements when defining a variable?
Looking to do something like this:
Code:
def uptrend = SMI >((SMI[1] + SMI[2] + SMI[3]) / 3);
def lowpoint = if uptrend then 8 else 8;
def highpoint = if uptrend then 8 else 8;
def shortpoint = if uptrend then 6 else 10;
def coverpoint = if uptrend then 5 else 6;
def long_rsi_buy = if uptrend then 45 else 45;
def long_rsi_sell = if uptrend then 25 else 25;
def short_sma = if uptrend then 204 else 204;
But the lowpoint, hightpoint, shortpoint etc. aren't being recognized, Can you not use if statements when defining a variable?
Code:
Only constants expected here: highpoint CL function indexer of high at 109:77
Only constants expected here: coverpoint CL function indexer of low at 118:76
Only constants expected here: lowpoint CL function indexer of low at 129:19
Only constants expected here: highpoint CL function indexer of high at 129:56
Only constants expected here: highpoint CL function indexer of high at 130:24
Only constants expected here: _inline_referenced_param_bSRP_9451_length CL constant function parameter 'length' at 136:48
Only constants expected here: shortpoint CL function indexer of high at 136:25
Only constants expected here: coverpoint CL function indexer of low at 136:112
Only constants expected here: _inline_referenced_param_bSRP_9463_length CL constant function parameter 'length' at 137:45
Only constants expected here: coverpoint CL function indexer of low at 137:23
Only constants expected here: highpoint CL function indexer of high at 109:77
Only constants expected here: coverpoint CL function indexer of low at 118:76
Only constants expected here: lowpoint CL function indexer of low at 129:19
Only constants expected here: highpoint CL function indexer of high at 129:56
Only constants expected here: highpoint CL function indexer of high at 130:24
Only constants expected here: _inline_referenced_param_bSRP_9451_length CL constant function parameter 'length' at 136:48
Only constants expected here: shortpoint CL function indexer of high at 136:25
Only constants expected here: coverpoint CL function indexer of low at 136:112
Only constants expected here: _inline_referenced_param_bSRP_9463_length CL constant function parameter 'length' at 137:45
Only constants expected here: coverpoint CL function indexer of low at 137:23