You don't need Norgate to get market cap. Please read the links I have posted.
You haven't even clicked on them.
Only supported functions and functionalities are AmiBroker ones.
For the rest you have to got to 3rd party forum or support.
This is not Norgate support forum.
Do like this and you do not need 3rd party for such simple things.
MarketCap = NorgateFundamentals("mktcap");
Filter = MarketCap > 300 AND MarketCap < 2000;
AddColumn(MarketCap,"MarketCap",1.2);
_SECTION_END();
type or paste code here
Ok I'm not getting any AFL errors anymore however the results don't seem to be working on my backtest.. I am still getting stocks show up in backtest with cap size much larger than $2billion.
The location of the cap site formula in the code shouldn't matter right? I have it towards the top anyway.
If a formula requires multiple conditions, you can combine the conditions with AND and OR operators. For example, maybe you'd like to plot a +1 when the MACD is greater than zero and the RSI is greater than 70:
Condition = MACD() > 0 AND RSI(14) > 70;
You can add as many conditions within a formula as you like.
So writing AND > (so combining logical operator with other operators) clearly makes not any sense. AND can not be greater than, smaller than, equal to something else. AND is an operator to connect two boolean conditions (which return true/false).
So only lines similar to below one or the ones of the manual make sense
x = RSI();
condition = x > 30 AND x < 70;
Or
x = RSI();
condition = x < 30 OR x > 70;
or...
x = Close;
y = MA(x, 20);
condition = x > 5 AND x >= y;
etc.
In upper examples on left and right side of comparison operators such as <>== etc. there have to be numeric variables (such as x array variable in upper example) or values/scalars. Then you can connect multiple comparisions with logical operator such as ANDOR but do not combine operators with operators ( AND < 70 -> incorrect).
Please take the time to read the given links of 2nd post and how to fill fundamental data to AB database.
Check return value of Shares Outstanding.
// output in interpretation window if line being applied to chart
printf("shares oustanding: %g", GetFNdata("SharesOut"));
I've been trying everything and studying for the last few hours. I've gone through your links, It seems I need to use the 'Country' with this because I am in Australia and trading ASX.
Have you read any of the three links provided in post #2?
AFL Function Reference - GETFNDATA
GetFnData
get fundamental data Information / Categories
(AFL 2.90)
SYNTAX
GetFnData( ''field'' )
RETURNS
NUMBER or STRING
FUNCTION
GetFnData allows accessing fundamental data from Information window (Window->Symbol Information) "field" parameter can be one of the following:
It just calls the fundamental data of Information window (per symbol).
So the data can be any country's data.
How to fill in data there is described in first link of post #2.
Simply download fundamental data via AmiQuote.
No one knows your information window content and no one knows your result list output of explorer.
No one knows what you have done so far.
No.
Since I do not want to waste more time on this.
Go on using that NG function of your first post.
If you have any problems with that function then call their support.
They get paid for that.
Your major mistake was incorrect use of operators.
I'm sorry to frustrate you I'm not a programmer. I'm Just trying to get this one thing working so I can use an existing AFL file to filter via market cap and then thats all i want to ever program.
I've read all the links you've sent me plus countless other things on the net. Trying to educate myself to try to get this one off task done
Just too hard.
I understand you are trying to help but, its all too hard it's like I'm trying to learn a whole foreign language such as Chinese just to read instructions on how to bake a cake
Anyway thank you for trying to help its much appreciated again sorry for the frustration.
@frankieplus,
Market capitalization is simply the number of outstanding shares multiplied by the share price , i.e.: sharesOutstanding x C
You can use the links which @fxshrat listed to write some simple code to download the Shares Outstanding data from Yahoo Finance using AmiQuote. It's really easy, however, you need to obtain this data and put it into your AmiBroker database (again, follow the examples in the links).
If Norgate is providing the Market Cap data then just reach out to their support team for assistance to write the necessary code.
Better yet, do both and begin your journey to become a programmer. (It will be worth it.)
P.S. AB can be hard, but it's not too hard. Hang in there.
Yep. Thank you for that explanation of the shares outstanding .
The journey to get this resolved has led me down a path where I feel it would actually be helpful to understand AFI somewhat. That way I can add things to this major code I have here (the one I am trying to add MarketCap to)
I studied the Norgate site and came up with adding PE and PS ratios to my code as well.
So now everything works fine except ONLY as an exploration. This will NOT work when I try it as a backtest
I can't understand why won't work as a backtest..
MarketCap = NorgateFundamentals("mktcap");
PE = NorgateFundamentals("peexclxor");
PS = NorgateFundamentals("ttmpr2rev");
MarketCap > 300 AND MarketCap < 4000 PE > 0 AND PE < 10 AND PS > 0 AND PS < 5;
AddColumn(MarketCap,"MarketCap",1.2);
AddColumn(PE, "PE",1.2);
AddColumn(PS, "PS",1.2);