jeudi 22 septembre 2016

Generating REALISTIC buy and sell signals in Amibroker backtesting

I am new to coding, and am trying out a simple strategy just for practice purposes. I am trying to generate a realistic BuyPrice for my AFL.
After a buy signal is triggered, I want the BuyPrice to be set to the low of the next 1 minute bar.

I know that I can use something like the following:
Code:

SetTradeDelays(1,0,0,0);
BuyPrice=low;

Things go on smoothly when I am backtesting my strategy with 1minute time frame. But I want to run my strategy on an Hourly timeframe. In such a case, with the above code, my BuyPrice is triggered at low of the next hourly candle after buy signal. But I want BuyPrice to be the low of next 1 minute bar and not the next 1 hour bar. Could this be done on a hourly chart?

Any help will be greatly appreciated.
Thanks


Generating REALISTIC buy and sell signals in Amibroker backtesting

Aucun commentaire:

Enregistrer un commentaire