Here you go:
Buy Order:
Hour() > 13 AND Hour() < 17 AND Ref(Cross(C, Mov(C,50,E)),-1) AND H > Ref(H,-1)
Sell Order:
Hour() > 13 AND Hour() < 17 AND L < ValueWhen(1 , Cross(C, Mov(C,50,E)), L) or
Hour() > 13 AND Hour() < 17 AND H >= ValueWhen(1 , Cross(C, Mov(C,50,E)), L) + 10
Sell Short Order:
Hour() > 13 AND Hour() < 17 AND Ref(Cross(Mov(C,50,E),C),-1) AND L < Ref(L,-1)
Buy to Cover Order:
Hour() > 13 AND Hour() < 17 AND H > ValueWhen(1 , Cross(Mov(C,50,E), C), H) or
Hour() > 13 AND Hour() < 17 AND L <= ValueWhen(1 , Cross(Mov(C,50,E), C), H) - 10
To: equismetastock@xxxxxxxxxxxxxxx From: sethuramansid@xxxxxxxxx Date: Sun, 22 Feb 2009 07:18:14 +0530 Subject: RE: [EquisMetaStock Group] Backtesting
Dear Peter,
Thanks for the code.
I meant SL for stoploss, once buy or short sell triggered, my stoploss should be at 50 EMA bar's high(in case of short sell,50 ema bar's low for long position). Also my target is only fixed points(say for 10).
Can u please modify the coding with the above terms.
Regards S. Sethuraman
--- On Sat, 21/2/09, Pete Lieber <plieber@xxxxxxxxxxxnet> wrote:
From: Pete Lieber <plieber@xxxxxxxxxxxnet> Subject: RE: [EquisMetaStock Group] Backtesting To: "EquisMetastock" <equismetastock@yahoogroups.com> Date: Saturday, 21 February, 2009, 7:34 PM
I'm not sure what you meant by "SL". But here's your basic code:
Buy Order:
Hour() > 13 AND Hour() < 17 AND Ref(Cross(C, Mov(C,50,E)) ,-1) AND H > Ref(H,-1)
Sell Order:
Hour() > 13 AND Hour() < 17 AND Cross(Mov(C, 50,E),C)
============ ========= ========= ========= =
Here's another code with my intrepretation of "SL":
Buy Order:
Hour() > 13 AND Hour() < 17 AND Ref(Cross(C, Mov(C,50,E)) ,-1) AND H > Ref(H,-1)
Sell Order:
Hour() > 13 AND Hour() < 17 AND L < ValueWhen(1 , Cross(C, Mov(C,50,E)) , L)
Sell Short Order:
Hour() > 13 AND Hour() < 17 AND Ref(Cross(Mov( C,50,E),C) ,-1) AND L < Ref(L,-1)
Buy to Cover Order:
Hour() > 13 AND Hour() < 17 AND H > ValueWhen(1 , Cross(Mov(C, 50,E), C), H)
You might want to consider removing the hour restriction on the Sell Order and Buy to Cover Order!
To: equismetastock@ yahoogroups. com From: sethuramansid@ yahoo.com Date: Sat, 21 Feb 2009 06:03:12 +0000 Subject: [EquisMetaStock Group] Backtesting
Dear All Friends,
I have very little knowledge with metastock software. I want to backtest my trading strategy. I want to test the system based on following the conditions
1. Testing to be done in 5 min chart 2. When price cross above 50 period EMA,if the very next bar is going higher than crossing bars high, buy should be triggered. SL is the low of the crossing bar. 3. Selling should be triggered in the next bar when price crossing below 50 period EMA,SL is cross bars high. 4. This should be done between a particular period for every day,(i.e 1.00 PM to 5.00 PM like this)
Can anyone give me the coding for the above conditions.
Waiting for your replies.
|
Add more friends to your messenger and enjoy! Invite them now.
__._,_.___
__,_._,___
|