Timer for trading system :

rkkarnani

Well-Known Member
#3
Hi,
can anyone tell me how to put a 1 year timer on a trading system devoloped for metastock .
In the Expert, after the Buy or sell formula mention :

"AND ((Year()<=2010) OR (Year()=2011 AND Month()<=04 AND DayOfMonth()<=30))"

This should put the Expiry to 30th April 2011.

Please check by creating an Expert and changing the date of the system as I may have erred.
 
#4
Thank you rkkarnani for providing the formula . It is working , but sometimes giving a black bar within an existing trend.
And it is not working at all in indicator building .
 
Last edited:

rkkarnani

Well-Known Member
#5
Thank you rkkarnani for providing the formula . It is working , but sometimes giving a black bar within an existing trend.
And it is not working at all in indicator building .
Can you post a Chart, not very sure but may be able to help!! Or send me any common expert formula that is not working with this, so that I can try to use it in my Metastock and give a feed back
 

rkkarnani

Well-Known Member
#6
Thank you rkkarnani for providing the formula . It is working , but sometimes giving a black bar within an existing trend.
And it is not working at all in indicator building .
May be use of Bar Since may work in Indicator builder... Suppose your indicator has 2 indicators for buy and sell ,

If( ((Year()<=2010) OR (Year()=2011 AND Month()<=04 AND DayOfMonth()<=30)),
If((BarsSince(L<Ref({Indicator name1},-1))>BarsSince(H>Ref({Indicator name2},-1)) ),{Indicator name1}{Indicator name2}),C);

Please try.. :p
 
#7
I have sorted out the problem and now the expert advisor is working perfectly.But the indicator is still not working .

Let me give an example :

Suppose i am working with this oscillator as indicator :

Mov((H+L)/2,5,S)-Mov((H+L)/2,34,S)

I want it to work till say 31st december 2011 . Now what will be the input in the indicator section ?
 
Last edited:

rkkarnani

Well-Known Member
#8
May be use of Bar Since may work in Indicator builder... Suppose your indicator has 2 indicators for buy and sell ,

If( ((Year()<=2010) OR (Year()=2011 AND Month()<=04 AND DayOfMonth()<=30)),
If((BarsSince(L<Ref({Indicator name1},-1))>BarsSince(H>Ref({Indicator name2},-1)) ),{Indicator name1}{Indicator name2}),C);

Please try.. :p
Not working..... :confused:
 

rkkarnani

Well-Known Member
#9
Try this :

a:=(H+L)/2;
b:=Mov(a ,5 ,S )- Mov(a ,34 ,S );
If((Year()<=2010) OR (Year()=2011 AND Month()<=03 AND DayOfMonth()<=31),a,0)
 

Similar threads