- Katılım
- 23 Eki 2020
- Mesajlar
- 1,828
-----Original Message----- From: owner-metastock@xxxxxxxxxxxxx [mailto Sent: Monday, January 08, 2001 1:10 AM To: metastock@xxxxxxxxxxxxx Subject: Re: Formula help Dave, Thank you very much. The Inactivity tab procedure worked exactly as I had hoped. The entry condition does not seem to make the entry that I have wanted. To explain, I have two conditions for entry: 1) The low of the price must be the lowest low value of any18 day period. 2) I want to enter above the high of that LLV (L,18) bar.I have tried the Ref(H,-1) and I have tried the Alert(C>=LLV(H,18), 3).All to no avail.(I tried the "Alert" function in an attempt to hold the statement for three bars after the LLV occured). I can get the L<=LLV(L,18) coupled with a close above the MP() to signal entry with no problem.I cannot, however, connect the L<=(L,18) statement with the statement that my entry can only occur above the high of the lowest bar. (I make my entry based on a % of ATR(50) above the high.) I have been trading, with success, this condition.I want to test and attempt to optimize the condition to enhance profits and feel more confident to increase the trade size.My exit has been C<Ref(L,-1). Now I can have that exit and the three day in trade rule to build upon. Again, thank you very much for the response. Hopefully, I have made clear my objective. If you can suggest a code for the entry it would be much appreciated. Thank you, Al Taglavore -----Original Message----- From: Dave Nadeau [mailto:dave_nadeau@xxxxxxxxx] Sent: Tuesday, January 09, 2001 12:29 AM To: metastock@xxxxxxxxxxxxx Subject: RE: Formula help Al, No problem. Since you've chosen the inactivity tab for the exit, I will stay with the assumed use of the MetaStock System Tester. So the setup is that the Low of a bar is the Lowest value in 18 bars. SETUP:=L=LLV(L,18); Your buy stop is set at a percentage of the ATR, I'll use 70% in this example; if the HIGH of the next or any subsequent bar is greater than this HIGH+0.7*(ATR(50)) {Note: I prefer the use of Mov(ATR(1),50,S) to the ATR(50) function. It eliminates some of the smoothing and seems to work better for me--credit to Chuck LeBeau}. LONGTRIGGER:=H>=(ValueWhen(1,SETUP=1,HIGH)+0.7*(ATR(50))); So by combining, |
|
Entry Condition Long SETUP:=L=LLV(L,18); LONGTRIGGER:=H>=(ValueWhen(1,SETUP=1,HIGH)+0.7*(ATR(50))); LONGTRIGGER=1 --- {to już ja dopisałem, ale tylko po to by zrobić z tego system w "obie strony"} Short SETUP:=H=HHV(H,18); SHORTRIGGER:=L>=(ValueWhen(1,SETUP=1,Low)-0.7*(ATR(50))); SHORTRIGGER =1 |
the system tester will make you LONG on your desired entry bar. You can set the entry to delay 1 bar and enter on the next open or enter on the high of that current LONGTRIGGER bar.I would like to set the entry to be, let's say that setup high plus 5 ticks or .25 for equities.Unfortunately, this is where the MetaStock Formula Language hits a limitation. Some coding with the PREV function will accomplish this, but it will effectively halt your processing time, especially on large explorations. You'll also notice that once you exit your trade, you can re-LONGTRIGGER without a new SETUP. This may or may not be desireable depending on your objectives.If it is not, we can code around this. I expect you are testing your entry conditions for winning percentage. Since you've used the ATR() for your entry, can I assume you'll be looking at replacing the hard three day stop with something like a chandelier exit or even a doubly adaptive one? I have to ask....this is similar to some systems I am currently working on. I hope this helps! Dave Nadeau Fort Collins, CO | |
| |
Source / From: |