AddColumn issue

Value = Volume*Close;
Buy = Up > .5;
Filter = Up;
AddColumn( Up, "Value");
AddColumn( Value, "Value", 1.2 );
AddColumn(O,"Open"); ```
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;
Buy = Up > .1;
Filter = Up;
AddColumn( Up, "Value");
AddColumn( Value, "Value", 1.2 );
AddColumn(O,"Open");

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
image
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.

Then refine your filter value.

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.

image

User guide: http://www.amibroker.com/guide/h_exploration.html and http://www.amibroker.com/guide/h_newanalysis.html

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);
AddColumn( Today, "Close");
AddColumn( Pivot, "Pivot");
AddColumn( PivotA, "PivotA");
AddColumn( Up, "Up");
AddColumn( Change, "% Change");
Filter = Change > 1;```