I would like to add the following volume information as a new custom column to the backtest results (list of columns generated when I click on the backtest button on Analysis window).
VolumeGain = Volume/ (MA( Volume, 50 ) );
The VolumeGain should show the value corresponding to the entry date of the trade.
Many many articles (having taken time to write up) are provided at AmiBroker knowledge base already.
Those articles cover most asked questions by (new or inexperienced) users.
Please read them (it's best practice to read all of the articles before asking questions in forum).
Hi! I've looked at both the linked guide and the solution here, but I can't figure out why my formula presents me only with an N/A.
Formula linked below. I'm trying to make it display the highest value for each stock in the holding period, but for simplicity's sake I went for just showing the highest value for each stock over 120 days.
Any assistance would be greatly appreciated and I apologise if this has been answered before, I could not find a solution nor could I figure it out from reading the manual/guides.
First, read the forum rules and learn how to post your code using code tags. Screenshots are not convenient if others want to try to run your code.
Second, your StaticVarGet() calls are incorrect. You probably want to be doing something like this:
symbolHigh = StaticVarGet(trade.Symbol + "High");
Third, Equity() is a function that runs a single-symbol backtest to generate an equity curve. Valid inputs for the first parameter are 0, 1, or 2 as explained here: AFL Function Reference - EQUITY If you are trying to set your initial equity, use SetOption().