I would like to look up the margin % from a CSV file for any stock in my trading universe and apply it in my AFL for setting trade size position.
I am wanting to reduce position size if the margin % is too high, otherwise I run the risk of using up all of my available equity before reaching my maximum number of open trades permitted.
Testing so far has focused on the VarGet function but have not made any progress.
Here are some ASX (Australia) stock examples with margin rates for the CFD broker I use:
CBA:5
BPT:10
EQT:35
MEK:60
TOK:80
I want to lookup the margin % based on the stock that I am exploring and pass it to my exploration AFL. Can someone please provide a suitable AFL subroutine.