'Buy at Close' in metastock

abcpankaj

Newbie
Messages
6
Likes
0
hi experts

In metastock >>system tester I want to test a system :
which places Buy order >>if todays (T+1) closing price is greater than yesterdays (T)closing price .

The below formulas places the order the next day (T+2)
C>Ref(C,-1)
Or
Cross (C,ref(C,-1))

any clues how can one place the order at the same days(T+1) closing price.


Thanks in advance
 
Certainly no expert, but I do understand why you are having a problem with the code.......going back in time is also a problem in reality.
You really have little option but to buy at open the next day.
 
When running a simulation, the screen after the one where you choose securities has a box lablled 'More...'. Click that and you'll see 'System Testing Options' along with a tab called 'TradeExecution' . Normally this defaults to 'Use realistic prices' If you uncheck the 'use realistic prices' check box, then you can change the delay order opening value to 0, and change 'Buy Price to 'Close'/ Sell PRice to Close. That should do it. In reality you'd need to be watching real-time for confirmation whether to place your order just before the close - doable, but a bit tricky until you have a process inplace for generating your watch list etc

Good luck! I have found Metastock a bit tricky for decent system testing. Be very careful how you write your code because it lets you peek at the future in testing.
 
Top