Back-Testing with Amibroker: How to code and test a strategy on a portfolio of stocks



If you would like advanced help with Amibroker please check out the Flagship Trading Course.... http://backtestwizard.com/flagship-training-course-information/

Comments

  1. Hi how can I see a weekly chart? how can I use a expert advisor on amibroker? Thanks
  2. You cannot tune the code after seeing the result you poision your data
  3. Can you backtest day trading strategies with amibroker? i.e. only executing the trade between 9:30 to 11:00 AM eastern time on 5 minute candles.
  4. Hi Mike,

    Apologies for the late reply. Regarding the 2s in the applystop line.....The first 2 is telling amibroker that the stop is trailing. Instead of 2 it can be written as 'StopTypeTrailing'

    The second 2 is telling the system that we want the stop-loss to be counted in points. Instead of 2 we can wrtite this as
    'StopModePoint'

    For example, in the code I use in the video we write the amount of points to be used in the trailing stop-loss by writing the line...
    TrailStopAmount = 5 * ATR (20);

    We then apply the stop by writing the line:

    Applystop (2,2,TrailStopAmount,0,True);

    Or if written in english:

    Applystop (StopTypeTrailing, StopModePoint, TrailStopAmount, 0, True);

    The '0' at the end of the line tells amibroker that we only want to check prices at the close.

    The 'True' tells amibroker that we want the ATR value to be dynamic, i.e. Each day the new ATR is to be calculated and applied to the 'TrailStopAmount'.

    In the book I suggest fixing the ATR amount used in the trailing stop-loss to be whatever it is on the day of the signal.

    To code that rule, simply change the 'true' to 'false'.

    I hope this helps.

    Once again, I do aplogise for not getting back to you sooner. If you have any other questions please don't hesitate to contact me. To get a quicker response email:

    llewelynjames@hotmail.co.uk

    Best Regards,

    Llewelyn
  5. Hi Llewelyn  - I see you have an 5 * ATR trailing stop coded in there but then what does the ApplyStop line with the 2s in it represent? Look forward to reading you book. - Mike


Additional Information:

Visibility: 11134

Duration: 14m 43s

Rating: 27