Save the value of a variable as a constant.


New member
Hello, I need to save the value of a variable as a constant.
That is, define B:

def A = open * 0.01;
def B = [I need to define B with the result of A as a constant]

If open is 100, then B = 1

I was looking for some function that allows me this, but I have not found anything. Sorry if this is too basic.
Last edited:


New member
Let's suppose that I want to save that specific value of A (with that specific value of OPEN, CLOSE, HIGH or any, in that specific bar), and then compare it in another bar, how can I do that?

In the example I have put, A will change on each bar depending on the OPEN value, but I need B not to change and just save the value of A on a specific bar.

Similar threads