hi,
I am new to amibroker. Any comments are appreciated.
I am try to generate insert SQL statements but it is giving me the same OHLC values for every line.
(refer to image)
Filter = Ref(High,-1) > Ref(HHV(High,260),-2); //Yesterday High higher than 52 week high of the day before (-2)
InsSQL = "INSERT INTO QUOTETABLE (QUOTESYMBOL,QUOTEDATE,Open,High,Low,Close) VALUES (";
InsSQL = InsSQL + "'" + Name() + "'" + ",";
InsSQL = InsSQL + "'" + Date() + "'" + ",";
InsSQL = InsSQL + Open + ",";
InsSQL = InsSQL + High + ",";
InsSQL = InsSQL + Low + ",";
InsSQL = InsSQL + Close + ")";
AddColumn(Open, "Open");
AddColumn(High, "High");
AddColumn(Low, "Low");
AddColumn(Close, "Close");
AddTextColumn(InsSQL,"SQL");
AddTextColumn adds just ONE TEXT (one string representing "SELECTED VALUE") per symbol. You can use AddTextColumn to display per-symbol (not per-bar) data such as full name, address, etc. You cannot add different texts for every bar on SAME symbol using AddTextColumn.
It is explained in the Knowledge Base:
The only way to do what you want is to use AddRow() function that adds a row of any text.