Traders' Tips from TASC Magazine |
|
|
Stochastics with Long Term EMA filter strategy
To create the STOCHASTICS WITH LONG TERM EMA FILTER strategy, one can use Strategy Builder which allows combining strategy and money management rules with the powerful capabilities of the Optimization Wizard and Genetic Algorithms.
To find the optimal parameters, one needs to replace the numeric constants in the trading rules with optimization variables. Additionally, one needs to specify the range (minimum, maximum) and step (increment) for each optimization variable.
The following is the code for the Stochastics with Long Term EMA filter strategy:
Entry Long
var
opt1:=#;
opt2:=#;
opt3:=#;
opt4:=#;
H_L:=Highest(C, opt1) - Lowest(C, opt1);
end_var
if (H_L=0) then return false; {prevent division by zero}
return Mov((C - Lowest(CLOSE, opt1)) / (H_L), opt2, S) < 0.5 - 0.01 * opt3 and CLOSE > Mov(CLOSE, opt4, E);
Exit Long
var
opt1:=#;
opt2:=#;
opt3:=#;
opt4:=#;
H_L:=Highest(CLOSE, opt1) - Lowest(CLOSE, opt1);
end_var
if (H_L=0) then return false; {prevent division by zero}
return Mov((CLOSE - Lowest(CLOSE, opt1)) / (H_L), opt2, S) > 0.5 + 0.01 * opt3 or CLOSE < Mov(CLOSE, opt4, E);
Entry Short
var
opt1:=#;
opt2:=#;
opt3:=#;
opt4:=#;
H_L:=Highest(CLOSE, opt1) - Lowest(CLOSE, opt1);
end_var
if (H_L=0) then return false; {prevent division by zero}
return Mov((CLOSE - Lowest(CLOSE, opt1)) / (H_L), opt2, S) >0.5 + 0.01 * opt3 and CLOSE < Mov(CLOSE, opt4, E);
Exit Short
var
opt1:=#;
opt2:=#;
opt3:=#;
opt4:=#;
H_L:=Highest(CLOSE, opt1) - Lowest(CLOSE, opt1);
end_var
if (H_L=0) then return false; {prevent division by zero}
return Mov((CLOSE - Lowest(CLOSE, opt1)) / (H_L), opt2, S) < 0.5 - 0.01 * opt3 or CLOSE > Mov(CLOSE, opt4, E);
After the optimization, one can view and analyze the Strategy Performance Report and Trades Report - on each combination of the values tested, as well as the combination's Equity and Drawdown curves. The best combinations can be saved as separate strategies.
|
Download to import into Tradecision. 
How to use this indicator in Tradecision:
- Click Download.
- Save this indicator in a safe location on your hard drive.
- Open Tradecision and in the Tools menu click Indicator Builder.
- In the Indicator Builder dialog, click Import, locate the saved file and then click OK.
The indicator will be added to the Custom Indicators list.
|
|
| |
| Sep 2007 |
|
| Aug 2007 |
|
| Jul 2007 |
|
| Jun 2007 |
|
| May 2007 |
|
| Apr 2007 |
|
| Mar 2007 |
|
| Feb 2007 |
|
| Jan 2007 |
|
| Dec 2006 |
|
| Nov 2006 |
|
| Oct 2006 |
|
| Sep 2006 |
|
| Aug 2006 |
|
| Jul 2006 |
|
| Jun 2006 |
|
| May 2006 |
|
| Apr 2006 |
|
| Mar 2006 |
|
| Feb 2006 |
|
| Jan 2006 |
|
| Mar 2005 |
|
| Mar 2005 |
|
| Feb 2005 |
|
| Feb 2005 |
|
| Dec 2004 |
|
| Nov 2004 |
|
| May 2004 |
|
| Dec 2003 |
|
| Oct 2003 |
|
| Jul 2003 |
|
| Apr 2003 |
|
| Mar 2003 |
|
| Mar 2003 |
|
| Feb 2003 |
|
| Jun 2001 |
|
| Jun 2001 |
|
| Jun 2001 |
|
| Jun 2001 |
|
| Jun 2001 |
|
| Apr 2001 |
|
| Feb 2001 |
|
| Aug 2000 |
|
| Aug 2000 |
|
| Feb 2000 |
|
| Jan 2000 |
|
| Sep 1999 |
|
| Sep 1999 |
|
|
|
|