The problem I have is I don't know what built in accessor functions or variables I have access to.
A wiki with them documented would be nice vs having to jump through these half documented how-to's.
I'm new to this editor. I've only written one function. I like the layout of your site. Please bear with me as I'm getting used to it. I work better with top level wiki's and hyperlinks.
A glossary of all available built in variables and functions would be nice
The previous bar value can be accessed using the "ref" function or using []
Example:
a = ref(close, 1);
a = close[1];
To get the moving average of the volume for the past 3 bars:
a = sma(volume, 3);
The link on how to create a custom trading indicator shows instructions on how to create custom function in c# (not in QS language). This is in case the formula is too complex to be implemented in QS language.
Please also check this QS language introduction:
https://www.quantshare.com/sa-499-quantshare-programming-language-tutorial
and saved it as vama.azf and added to indicators and it plotted
https://imgur.com/a/5Bvk9XQ
yay! I'm making progress. I suppose you don't know how I could turn this into a function that would accept any value of n? I suppose I could answer that question myself. I'd like to recursively iterate through each close/volume up to n so I can call vama like vama(3) and have it do 3 periods vs a static 3 each time. I might even modify it to be exponential.
The reason I'm relying on this so heavily is because machine learning likes equally sampled data points (i.e. at specific tradeable units, which time is not). Such as trades by dollar or volume and vama is a great candidate.
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.