Differenze tra le pagine "TS Keltner Channels" e "TS Key Reversal Pattern"
imported>Stefano Fanton |
imported>Stefano Fanton |
||
Riga 1: | Riga 1: | ||
− | '''''Trading System " | + | '''''Trading System "Key Reversal Pattern"''''' |
+ | |||
+ | Codice in EasyLanguage per una strategia basata sul key reversal pattern. | ||
Formula per Tradestation™: | Formula per Tradestation™: | ||
Riga 5: | Riga 7: | ||
INIZIO FORMULA | INIZIO FORMULA | ||
− | Type : | + | Type : Strategy, Name : Key Reversal Pattern <br>Input: StopLossAmount( 250 ) ; |
+ | |||
+ | variable: KRPattern( false ) ; | ||
+ | |||
+ | KRPattern = Low < Low[1]<br>and Close > Close[1]<br>and Close < High ; | ||
+ | |||
+ | { You are counting how many times the pattern recurs. <br>INCREMENT THE COUNT ONE BAR AFTER THE KR IS CONFIRMED. } | ||
+ | |||
+ | if KRPattern[1] then<br>begin<br>Value1 = Value1 + 1 ; | ||
+ | |||
+ | { If there is a key reversal up pattern, <br>how many times is the following high greater or equal to the last high? } | ||
+ | |||
+ | if High >= High[1] then<br>Value2 = Value2 + 1 ;<br>end ;<br>{ Now send the results to a text file } | ||
− | + | if LastBarOnChart then<br>begin<br>Print( File( "C:\Patt.txt" ), GetSymbolName,<br>" ", ELDateToString( CurrentDate), " Time: ",<br>CurrentTime:4:0 ) ;<br>Print( File( "C:\Patt.txt" ),<br>"Key Reversal Up Pattern" ) ;<br>if Value1 <> 0 then<br>begin<br>Print( File( "C:\Patt.txt" ),<br>"Pattern ", Value1:4:0 ) ;<br>Print( File( "C:\Patt.txt" ), "Total bars ",<br>BarNumber:4:0, " Observation on total bars ",<br>Value1 / BarNumber * 100, "%" ) ;<br>Print( File( "C:\Patt.txt" ),<br>"Next high is greater or equal to prev high ",<br>Value2:4:0, Value2 / Value1 * 100, "%" ) ;<br>end ;<br>end ; | |
− | + | { If you want to see trading signals include the code below } | |
− | + | if KRPattern then<br>begin<br>Buy this bar on Close ;<br>Sell ( "Target" ) next bar at High limit ;<br>end ;<br>SetStopPosition ;<br>SetStopLoss( StopLossAmount ) ;<br>if BarsSinceEntry = 1 then<br>Sell ( "EOD" ) this bar on Close ;<br><br>FINE FORMULA | |
== Vedi anche: == | == Vedi anche: == |
Versione attuale delle 09:48, 22 mar 2012
Trading System "Key Reversal Pattern"
Codice in EasyLanguage per una strategia basata sul key reversal pattern.
Formula per Tradestation™:
INIZIO FORMULA
Type : Strategy, Name : Key Reversal Pattern
Input: StopLossAmount( 250 ) ;
variable: KRPattern( false ) ;
KRPattern = Low < Low[1]
and Close > Close[1]
and Close < High ;
{ You are counting how many times the pattern recurs.
INCREMENT THE COUNT ONE BAR AFTER THE KR IS CONFIRMED. }
if KRPattern[1] then
begin
Value1 = Value1 + 1 ;
{ If there is a key reversal up pattern,
how many times is the following high greater or equal to the last high? }
if High >= High[1] then
Value2 = Value2 + 1 ;
end ;
{ Now send the results to a text file }
if LastBarOnChart then
begin
Print( File( "C:\Patt.txt" ), GetSymbolName,
" ", ELDateToString( CurrentDate), " Time: ",
CurrentTime:4:0 ) ;
Print( File( "C:\Patt.txt" ),
"Key Reversal Up Pattern" ) ;
if Value1 <> 0 then
begin
Print( File( "C:\Patt.txt" ),
"Pattern ", Value1:4:0 ) ;
Print( File( "C:\Patt.txt" ), "Total bars ",
BarNumber:4:0, " Observation on total bars ",
Value1 / BarNumber * 100, "%" ) ;
Print( File( "C:\Patt.txt" ),
"Next high is greater or equal to prev high ",
Value2:4:0, Value2 / Value1 * 100, "%" ) ;
end ;
end ;
{ If you want to see trading signals include the code below }
if KRPattern then
begin
Buy this bar on Close ;
Sell ( "Target" ) next bar at High limit ;
end ;
SetStopPosition ;
SetStopLoss( StopLossAmount ) ;
if BarsSinceEntry = 1 then
Sell ( "EOD" ) this bar on Close ;
FINE FORMULA