Preston,
the code for the buy orders is
m:=Security("D:\MetaStock Data\XXX",C);
mki:=MOV(m,opt1,S);
mki>Ref(mki,-1)
and for the sell orders
m:=Security("D:\MetaStock Data\XXX",C);
mki:=MOV(m,opt1,S);
mki<Ref(mki,-1)
I used this code, adjusted for the lag of one bar, together with the further
additional condition that hight > ref(high,-1) for a buy arrow and low <
ref(low,-1) for the sell arrows in the expert advisor. The expert advisor
generates arrows, which match the signal I get with Excel or TradeStation.
I have the suspicion that the price in the Limit and Stop Price field is
creating the problem that orders are not executed at the correct price in the
system tester.
Peter
________________________________
Von: pumrysh <[email protected]>
An: [email protected]
Gesendet: 22:28 Freitag, 21.September 2012
Betreff: [EquisMetaStock Group] Re: System Tester
Peter,
I think it would be best if you post the code for us.
Preston
--- In mailto:equismetastock%40yahoogroups.com, Peter Fertig <pfertig@...>
wrote:
>
> Hello,
>
> I have a problem with the system tester. I want to test a smoothed indicator.
> The logic of the system is to buy if this indicator is higher than at the
> previous bar. Accordingly, a sell is allowed if the indicator is lower than
> at the previous bar. The buy order should be executed at the next bar but
> only if the high of the current bar is exceeded. Similar, a sell order should
> be executed only if the low of the next bar is lower than the low of the
> current bar. The system would be always in the market. Thus, orders should be
> entered on a stop and I have put in the Limit or Stop Price field High for
> the orders to buy and Low for the orders to sell.
>
> The problem is now the accuracy of the system test reports. I have tested the
> system also with TradeStation and with Excel. In the case that the order
> could be executed at the next bar after the indicator turned direction, the
> results of the system tester in MetaStock are the same as those from
> TradeStation or Excel. However, if the condition for the order is still in
> place but the order could be executed only a few bars later, the results
> diverge significantly. The system tester uses not the high or low price of
> the current bar, but of some bars ago. Even the number of bars ago is not
> constant but differs from trade to trade.
>
> The manual does not provide any help. Are those incorrect order executions a
> bug of the system tester or do I have to put in another value in the Limit or
> Stop Price field for the various order types? Any hint is highly appreciated.
>
> Best regards
>
> Peter
>