``````Value = Volume*Close;
Filter = Up;
I'm very new to AFL
None of  "AddColumn" works and "Up" calculation return wrong number(I'm assuming)?
I'm runing Version 6.30.0 64 bit``````

Variable Up not assigned

@rbts your problem is pretty easy to solve but you must be a licensed user to post on this forum

1 Like

Your formula does not contain definition of "Up" variable.

Your code is simply incomplete. A complete code would need to define the "Up" variable.
It is better if you describe in plain words what you want to achieve.
As an example of correct formula would need to define Up variable. For example this way:

``````Up = Close - Open; // you must define Up variable BEFORE you use it
``````
``````Value = Volume*Close;
Filter = Up;
``````

None of the addcolums works and "Up" calculations is not correct ?

Your formula does not contain definition of "Up" variable.

Your code is simply incomplete. A complete code would need to define the "Up" variable.
It is better if you describe in plain words what you want to achieve.
As an example of correct formula would need to define Up variable. For example this way:

``````Up = Close - Open; // you must defined Up variable before you use it
``````

I'm trying to calculate(Up variable):
(Current CLOSE minus CLOSE 18 day ago ) than divide that by CLOSE 18 day ago
Can someone help with this please

I'm trying to follow instruction, have a look what I'm getting screen shot below Not sure if you getting my snip image?

@RomanPL, why don't you try setting the filter to 1 to start.

See if you are getting the values in the columns that you want.

I find having results in the exploration allow me to "work" on figuring out my code.

My problem is that I'm not generating and new column so I can not see what the value of the variable.

@RomanPL, go back to basics...

Set the filter to "1" and then see what shows up. Add a new calculation for say the mid point, and then use then Add that column and see if that works.

Just get back to basics to prove to yourself that the functions work, then you can move on to work on figuring out why your calculations are not producing values....

### That is because you pressed SCAN instead of pressing EXPLORE button in the Analysis.

AddColumn is the function that works with Exploration, so you must press EXPLORE button. And your Up formula for 18-bar rate of change should look as follows:

``````Up = (Close - Ref( Close, -18 ) ) / Ref(Close, -18 );
``````

or better yet just:

``````Up = ROC( Close, 18 );
``````

It works Thanks Tomasz!
My code looks like this

``````Change = Up / Ref( Close,-20);
Today = Close;
Pivot = Ref(Close,-20);
PivotA = Ref(Close,-3);