Home
    Product
    Support
    Purchase
    Company

Advanced trading software: technical analysis and neural networks

Empowering wise traders

Support Center
Publications
Tradecision FAQs
Improvian Consulting
Contact Support Team
Knowledgebase
Collection of Indicators
Custom Indicators
Custom Studies
TASC Traders' Tips
Active Trader Strategies
Golden Trading Rules
Traderís Quiz

Traders' Tips from TASC Magazine
Combining DMI and Moving Average for a EUR/USD trading system

The article by Rombout Kerstens in this issue, "Combining DMI and Moving Average for a EUR/USD trading system", has demonstrated how the combination of the moving average (MA) and the directional movement index (DMI) can limit the number of trades while delivering better results per trade.

Using Strategy Builder, you can create the strategy for the described method.

Here is the Tradecision code for the strategy:

Long:

Var

 ParamMA:=30;

 ParamDMI:=14;

 DMILong:=false;

 DMIShort:=false;

 MALong:=false;

 MAShort:=false;

 vDMIMinus:=0;

 vDMIPlus:=0;

 MA:=0;

 End_var

 

 vDMIMinus := DMIMinus(ParamDMI);

 vDMIPlus := DMIPlus(ParamDMI);

 MA := SMA(Close,ParamMA);

 

 if HISTORYSIZE > ParamMA then

    begin

         if CrossAbove(vDMIPlus,vDMIMinus)

         then

              begin

              DMILong := true;

              DMIShort := false;

              end;

         if CrossBelow(vDMIPlus,vDMIMinus)

         then

             begin

             DMILong := false;

             DMIShort := true;

             end;

         if CrossAbove(Close,MA)

         then

             begin

             MALong := true;

             MAShort := false;

             end;

         if CrossBelow(Close,MA)

         then

             begin

             MALong := false;

             MAShort := true;

             end;

 

 If dmilong = true and malong = true then

 return true;

end;

return false;

 

Short:

Var

 ParamMA:=30;

 ParamDMI:=14;

 DMILong:=false;

 DMIShort:=false;

 MALong:=false;

 MAShort:=false;

 vDMIMinus:=0;

 vDMIPlus:=0;

 MA:=0;

 End_var

 

 vDMIMinus := DMIMinus(ParamDMI);

 vDMIPlus := DMIPlus(ParamDMI);

 MA := SMA(Close,ParamMA);

 

 if HISTORYSIZE > ParamMA then

    begin

         if CrossAbove(vDMIPlus,vDMIMinus)

         then

              begin

              DMILong := true;

              DMIShort := false;

              end;

         if CrossBelow(vDMIPlus,vDMIMinus)

         then

             begin

             DMILong := false;

             DMIShort := true;

             end;

         if CrossAbove(Close,MA)

         then

             begin

             MALong := true;

             MAShort := false;

             end;

         if CrossBelow(Close,MA)

         then

             begin

             MALong := false;

             MAShort := true;

             end;

 

 If dmishort = true and mashort = true then

 return true;

end;

return false;


Download to import into Tradecision.

How to use this indicator in Tradecision:
  1. Click Download.
  2. Save this indicator in a safe location on your hard drive.
  3. Open Tradecision and in the Tools menu click Indicator Builder.
  4. 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.
 
Combining DMI and Moving Average for a EUR/USD trading system
Tradecision Reviews
Video Tours
Ask a question

Site Map   |   Terms of Use   |   Privacy Policy   |   Risk Warning
Forex, equities or futures trading involves substantial risk of loss and is not suitable for all investors.
Copyright © 2001-2017 Alyuda Research, LLC.  All rights reserved