View Single Post
  #1006 (permalink)  
Old 06-09-2009, 09:54 AM
derekc derekc is offline
Junior Member
 
Join Date: Sep 2006
Posts: 22
derekc is on a distinguished road
20DP Expert

Hi paijolopez,

I have set up the ea to follow the rules as per the 20dp system. The code can be found in the EA under the section "//Calculate 20P pending entry prices"

The EA will place a sellstop or buystop order at the start of the trading session.

The EA will handle an extra decimal place on the quote value, Alpari
has recenly introduced this. (GBPUSD = 0.00001). Also if the pair has 2 or 3 digits like USDJPY.

The orders are set to expire at the end of the trading session as specified or after 5 hours from opening if they are not hit.

The EA is limited to take only max of 1 OP_BUY or OP_SELL trade per day, if the we already have had 1 OP_BUY or OP_SELL no more orders will be placed until the next day. This code can be found in the EA under the section "//Test how many trades have been taken for the day, we must only do 1 trade per day"

This EA also has the functionality to palce long and short stop orders and cancel the other when becomes an open order although this is not necessary with the 20dp system.

If you want to test on other pairs then simply drop the EA on the chart, you will need an M1, H1 and Daily chart open. Also the variable values will need to be altered to suit.

The meaning of the variables is as follows:

_MagicNumber
Is the unique number assigned to the order so the EA can manage the order, this will allow trading of multiple pairs.

Loss and profit targets
StopLoss1 = 30;//distance to StopLoss in points (0 - disable)
TakeProfit1 = 20;//distance to TakeProfit in points (0 - disable)
TrailingStop1 = 150;//Trailing Stop in points (0 - disable), we are not using a trainig stop in the 20DP system so it is set to a high level or just make it = 0 to disable it.
Level1=21;// A level as specified in the 20DP rules
Level2=41;// B Level as specified in the 20DP rules

Money management
risk1 = 8;//This is the % loss of your account balance you would like to risk. The EA will calculate the number of lots needed in order to risk x % of the account value if the stoploss is hit assuming the account is USD.
Currently In the EA the default number of lots is = 1 for testing purposes, this is under the "//Money management" section.

Set session time period//
This gives us the option of specifying during which hours of the day you want to trade when the volumes are the highest. You can have 2 trading sessions if needed. as below.
Afternoonst = 6;//Session open, maybe Europe US market open
Afternoonend = 17;//Session close, maybe Europe US market close
Morningst = 6;//Session open, maybe Asian market open
Morningend = 6;//Session close, maybe Asian market close
Reply With Quote