Worst case back testing - buy high, sell low  [SOLVED]

Questions about MultiCharts and user contributed studies.
drjunzhao
Posts: 15
Joined: 10 Sep 2013
Has thanked: 1 time
Been thanked: 1 time

Worst case back testing - buy high, sell low

Postby drjunzhao » 19 Oct 2013

Hi,

Is it possible to set MC back testing to just use the "high price" when buy, and use the "low price" when sell?

I am using Heikin Ashi bar, thus close and open are different from market quotes. The current back test with limit order in MC always uses the logic "buy at low" and "sell at high" on next bar open. This is useless in this case as most of the time you cannot get these prices. My goal is to back test in worst case. If a strategy performs well in worst case, it will have a very good chance to perform reasonably well in real-trading.

Thanks,

Jun

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Worst case back testing - buy high, sell low

Postby Andrew MultiCharts » 21 Oct 2013

Hello Drjunzhao,
Is it possible to set MC back testing to just use the "high price" when buy, and use the "low price" when sell?
There is no such option in MC.
I am using Heikin Ashi bar, thus close and open are different from market quotes. The current back test with limit order in MC always uses the logic "buy at low" and "sell at high" on next bar open. This is useless in this case as most of the time you cannot get these prices. My goal is to back test in worst case. If a strategy performs well in worst case, it will have a very good chance to perform reasonably well in real-trading.
Please read how orders are executed in backtesting. In your case the Bar Magnifier is not available (for non-standard chart types), so you should pay attention to "Calculation on historical data. Regular mode (IOG disabled. Bar Magnifier disabled)" paragraph.
I also recommend you to print the order price generated by your script and OHLC prices of the bars in order to adjust the script to make it work as you expect.

User avatar
Alex MultiCharts
Posts: 194
Joined: 09 Aug 2013
Has thanked: 43 times
Been thanked: 77 times

Re: Worst case back testing - buy high, sell low

Postby Alex MultiCharts » 21 Oct 2013

Hello Drjunzhao,
Is it possible to set MC back testing to just use the "high price" when buy, and use the "low price" when sell?
There is no such option in MC.
Hello,

what Andrew meant is that there is no such an option, you can only execute it in the script.

If you want to buy at the highest price and sell at the lowest price, you can write as following:

buy next bar at high limit;
sellshort next bar at low limit;

You can also use the offset:

buy next bar at high+1 limit;
sellshort next bar at low-1 limit;

drjunzhao
Posts: 15
Joined: 10 Sep 2013
Has thanked: 1 time
Been thanked: 1 time

Re: Worst case back testing - buy high, sell low

Postby drjunzhao » 21 Oct 2013

**buy next bar at high limit;
**sellshort next bar at low limit;

Tried the above logic before and again today. MC always set to sell at high and buy at low, which is basically useless. I just need a way to "sell at low" and "buy at high" with or without using a script. Any other suggestion?

Thanks,

Jun

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Worst case back testing - buy high, sell low  [SOLVED]

Postby Andrew MultiCharts » 22 Oct 2013

**buy next bar at high limit;
**sellshort next bar at low limit;

Tried the above logic before and again today. MC always set to sell at high and buy at low, which is basically useless. I just need a way to "sell at low" and "buy at high" with or without using a script. Any other suggestion?
We provided all required information for you to study how and why your script executes orders. Please read the articles and enable or disable some features in MC / adjust your script if needed to affect it.

As you can see on the picture below, it doesn't always sell and buy at highs/lows:

Image

drjunzhao
Posts: 15
Joined: 10 Sep 2013
Has thanked: 1 time
Been thanked: 1 time

Re: Worst case back testing - buy high, sell low

Postby drjunzhao » 22 Oct 2013

Hi,

Can you please use 5 miniute Heikin Ashi bar, and let me what you see?

Thanks,

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Worst case back testing - buy high, sell low

Postby Andrew MultiCharts » 22 Oct 2013

Hi,

Can you please use 5 miniute Heikin Ashi bar, and let me what you see?

Thanks,
Image


Return to “MultiCharts”