- Katılım
- 23 Eki 2020
- Mesajlar
- 1,828
* To: <metastock@xxxxxxxxxxxxx> * Subject: Re: Exits * From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxx> * Date: Sat, 11 Aug 2001 14:35:14 +1200 * References: <024901c121ee$4d83c960$5d549f40@xxxxx> * Reply-To: metastock@xxxxxxxxxxxxx * Sender: owner-metastock@xxxxxxxxxxxxx Randy > I am writing a system tester for an idea I had. > My problem is: I am trying to exit on the fourth day after I enter long. > On the exit page: I type: BarsSince(Long)==4; > This will not work. Any ideas? Try this for a delay timed from the trailing edge of the entry signal. This will function as an indicator provided the entry is also coded as an indicator. To use directly in the System Tester you would need to either still have the entry coded as an indicator or include all the entry code as Signal:=XXXX. If using the MS System Tester why not use identical code for entry and exit, and use the tester delay facility for Close Long. |
|
Long Entry {only sample} MACD() > 0 AND C > Ref(H,-1) AND C > Ref(H,-2) AND C > Ref(H,-3) |
|
Timed Exit TE {from trailing edge} Delay:=Input("Exit delay periods",1,50,4); Signal:=Fml("Long Entry"); Pause:=Alert(Signal,Delay); Pause=0 AND Alert(Pause,2); |
and this for a delay timed from the leading edge of the entry signal. |
|
Timed Exit LE {from leading edge} Delay:=Input("Exit delay periods",1,50,4); Signal:=Fml("Long Entry"); Edge:=Signal AND Alert(Signal=0,2); Pause:=Alert(Edge,Delay); Pause=0 AND Alert(Pause,2); |
Roy PS: I have deliberately used the Alert() function rather than the Ref() function so as not to extend the indicator undefined period. However you need to be aware that the Alert() function can only be used directly with binary data (0 or 1). | |
| |
Source / From: |