RmS59
Member
I hope someone can help me with Recursive variables.
I want to capture if the last signal was a buy or if it was a sell.
How do I retain the status? When I try this, nothing plots.
def signalstate = if buysignal then 1 else if sellsignal then -1 else signalstate[1];
# buysignal and sellsignal only have a value when the signal occurs, and is equal to Double.NaN the rest of the time
plot Trend = signalstate;
Can someone educate me on what I am doing wrong?
thanks
I want to capture if the last signal was a buy or if it was a sell.
How do I retain the status? When I try this, nothing plots.
def signalstate = if buysignal then 1 else if sellsignal then -1 else signalstate[1];
# buysignal and sellsignal only have a value when the signal occurs, and is equal to Double.NaN the rest of the time
plot Trend = signalstate;
Can someone educate me on what I am doing wrong?
thanks