log in     sign up for free
 
The elements of good trading are: 1. Cutting losses, 2. Cutting losses, and 3. Cutting losses. If you can follow these three rules, you may have a chance.
Ed Seykota
 
 
Home
systems (285)
 
 
Special offer: buy MetaStock (try for free)   |   Reuters QuoteCenter Real-Time Data (get a free month)   |   EOD Data
 

Buy

MetaStock

     (special offer)
 
 
 

Buy

EOD data for MetaStock

     (special offer)
 
 
 

Buy

Realtime data for MetaStock

     (special offer)
 
 
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

2EMA System-v03

System for: MetaTrader

 

 

Views:  2027

Added: November 16, 2008
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 
 

email this link

 
 
Tags: MetaTrader, system
 


2EMA System-v03 EUR 5 minute auto trader

 

 



Code:

/*[[
Name := 2EMA system-v03
Author := Copyright © 2003, Smoky
Link := http://www.company.com/
Notes := 2 ema I use 5 minute on EUR
Update on every tick := Yes
Positions := Long & Short
Enable Alerts := Yes
Disable alert once hit := No
Lots := 1
Stop Loss := 50
Take Profit := 360
Trailing Stop := 15
]]*/

Defines: Slip(5),
lp(300),
risk(40),
sp(30),
mm(-1),
munth(9);



vars: direction(0),
orders(0),
first(0),
mode(0),
cnt(0),
Ilo(0),
sym(0),
b(0);


Comment(\"Account: \",AccNum,\" - \",AccName,
\"\\n\",\" StopLoss \", b,
\"\\n\",\" Lots \",Ilo);


//if month < munth then exit;

If Bars If IsIndirect(Symbol)=TRUE then Exit;
If CurTime - LastTradeTime < 1800 Then Exit;
b=5*Point+iATR(4,1)*5.5;
/**********************************Money and Risk Management***************************************
Changing the value of mm will give you several money management options
mm = 0 : Single 1 lot orders.
mm = -1 : Fractional lots/ balance X the risk factor.(use for Mini accts)
mm = 1 : Full lots/ balance X the risk factor up to 100 lot orders.(use for Regular accounts)
***************************************************************************************************
RISK FACTOR:
risk can be anything from 1 up.
Factor of 5 adds a lot for every $20,000.00 added to the balance.
Factor of 10 adds a lot with every $10.000.00 added to the balance.
The higher the risk, the easier it is to blow your margin..
**************************************************************************************************/

if mm < 0 then {
Ilo = ceil(Balance*Risk/10000)/10;
If Ilo > 100 then {
Ilo = 100;
}
} else {
Ilo = lots;
};
if mm > 0 then
{
Ilo = ceil(Balance*Risk/10000)/10;
If Ilo > 1 then
{
Ilo = ceil(Ilo);
}
if Ilo < 1 then
{
Ilo = 1;
}
If Ilo > 100 then
{
Ilo = 100;
}
};
//------------------------------------------------------------------------------------------------
If TotalTrades<1 then
{
if
(iMA(lp,MODE_SMA,3) iMA(lp,MODE_SMA,0)>iMA(sp,MODE_EMA,0)*0.998) &
iSAR(0.02,0.2,6)O
then
{
SetOrder(
OP_SELL,
ILO,
Bid,
Slip,
Bid+Stoploss*Point,
Bid-TakeProfit*Point,
Red);
Exit;
};
if
(iMA(lp,MODE_SMA,3)>iMA(sp,MODE_EMA,3)*1.002 &
iMA(lp,MODE_SMA,0) iSAR(0.02,0.2,6)>O[6] & iSAR(0.02,0.2,0) then
{
SetOrder(
OP_BUY,
ILO,
Ask,
Slip,
Ask-Stoploss*Point,
Ask+TakeProfit*Point,
White);
Exit;
};
};
//----------------------------------------Order Control-------------------------------------------

orders=0;
sym=0;
For cnt=1 to TotalTrades
begin

If Ord(cnt,Val_Symbol)=Symbol then
{
sym=cnt;
orders=1;

};
mode=Ord(sym,VAL_TYPE);

If mode=OP_BUY &
Ord(sym,VAL_SYMBOL)=Symbol then
{
If Ord(sym,Val_OPENPRICE)>Ord(sym,VAL_STOPLOSS) &
Bid-Ord(sym,Val_OPENPRICE)>(Ord(sym,Val_OPENPRICE)*0.004) &
iMA(lp,MODE_SMA,3) iMA(lp,MODE_SMA,0)>iMA(sp,MODE_EMA,0)*0.9978
then
{
CloseOrder(
Ord(sym,VAL_TICKET),
Ord(sym,VAL_LOTS),
Bid,
Slip,
Red);
Exit;
};
If (Bid-Ord(sym,VAL_OPENPRICE))>(b)then
{
If Ord(sym,VAL_STOPLOSS)<(Bid-b) then
{
ModifyOrder(
Ord(sym,VAL_TICKET),
Ord(sym,VAL_OPENPRICE),
Bid-b,
Ord(sym,VAL_TAKEPROFIT),
LimeGreen);
Exit;
};
};
};
If mode=OP_SELL &
OrderValue(sym,VAL_SYMBOL)=Symbol then
{
If Ord(sym,Val_OPENPRICE) Ord(sym,Val_OPENPRICE)-Ask>(Ord(sym,Val_OPENPRICE)*0.004) &
iMA(lp,MODE_SMA,3)>iMA(sp,MODE_EMA,3)*1.002 &
iMA(lp,MODE_SMA,0) then
{
CloseOrder(
Ord(sym,VAL_TICKET),
Ord(sym,VAL_LOTS),
Ask,
Slip,
Red);
Exit;
};
If (Ord(sym,VAL_OPENPRICE)-Ask)>(b) then
{
If Ord(sym,VAL_STOPLOSS)>(Ask+b) then
{
ModifyOrder(
Ord(sym,VAL_TICKET),
Ord(sym,VAL_OPENPRICE),
Ask+b,
Ord(sym,VAL_TAKEPROFIT),
HotPink);
Exit;
};
};
};
End;



 




 

Code to difficult? Find somebody to help you with coding here.

 



Author: Smoky
Source: www.xeatrade.com/

 

View similar:

2EMA System-v03
B % oscillator system
2ways system
ASC Trend ++ Expert(v.2.1)
Always In Play
5min USDCHF
Bolliger Breakout Ver 1.0
2EMA system
Awesome Oscillator auto Trader
...
 
 
all systems for MetaTrader
all systems

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
PayPalSecure payments by PayPal S4T™ is a part of TAURO EDUCATION NETWORK
 
Privacy note | (c) copyrights systems4trading.com 2006-2009