#bars error, temporary exit

good, had a very strange problem. I work with two computers, I have programmed a simple temporary exit. "numBars = 5 exit".
Well, in one computer it works out well, and in the other, with the same code it works out twice as much. that is, I do a Backtest:
pc 1: NumBars = 5, I do BT, result # bars = 10
pc 2: NumBars = 5, I do BT, result # bars = 5
But something curious happens, when I look at the chart for the specific ticker trade and the entry and exit day in the BT report, the duration of the trade gives good results and the number of days is 5 (in this example).
It's probably silly, but I can't solve it. I have the same preferences and options on both computers.
also say that when I do an individual BT if the temporary output that I have programmed in the two computers makes sense
Does anyone comes up with something? thanks

I have realized that when I backtest the symbols that come by default, the strategy makes sense, and the duration of the trade is what I program.
but with the sp500 imported from other software I get exactly twice the number of bars than I should, that is:
in the chart it comes out fine, but in #bars of the columns of the backtest result not
(all this on a computer with amibroker "AmiBroker6305x64")
but instead with the other computer, which has a previous amibroker, everything is as it should. any possible ideas?

You need to make sure you have SAME data on both, see:

  1. the data is from other software, I have exported a folder with 500 ticker .txt, I have saved it to a usb, and on each computer I have created my watchlist (s & p500). that is, the data should not be.
  2. my personal code that I have programmed is exactly the same.
    I use a simple entry for bull markets, quiet. and the output is a layered atr. (I have a couple of custom columns in backtest).
    In order to correct the problem, I have made code easier
period = 10; // 10 bars 
ChannelBreakUp = Close > Ref( HHV( High, period ), -1 );
Buy = ChannelBreakUp;
bars = 15; // exit after 15 bars
Sell=0;
Short=0;
Cover=0;
ApplyStop( stopTypeNBar, stopModeBars, bars, True );

duda amibroker

there is the problem, #bars I get double.
It is true that I have been looking for, and if I add in the code
SetBacktestMode(backtestRegularRaw)
It seems that #bars has the correct value, but in my personal code it would not be solved

We need formula AND settings.
Save your analysis project (File->Save As...) as .APX file and send here or to support

Sorry for the question, but how can I send that .apx file here? I only see that I can send images and afl code.
thanks

just send them an email at the support address with all the details attached.

I have done it and it tells me that it does not have my email registered in its base.

Auto-responder checks "From" email that you use and if it does not match registered email address you will get response that it is not in the DB. Simply write from registered address. If you changed email address, change it in the members area "account information" too.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.