| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Tester versus live trading
The EA I wrote runs well in the Tester and opens and closes transactions as required. However, when I use it on forward data by attaching it to a EURUSD graph and enable trading etc etc it never opens any trades. Anyone know what the reason is for that. Is there any function call necessary to switch on live trading?
By that I dont mean clicking the live trading box in the ea setup, I mean something you have to call in adition in your MT ea program. Thanks |
|
||||
|
whateveryouwant: it's hard to discover the problem whithout the code. It could be 20 reasons.
__________________
|
|
|||
|
Quote:
FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM NEW: video presentation of the Probability Meter ... 24hrs action on the website |
|
||||
|
MA Signals
Quote:
Take these 2 lines of code double MA_1 (int i = 0){return(iMA(NULL,0,MA1,MA1_SHIFT,MA1_MODE, MA1_PRICE,i));} double MA_2 (int i = 0){return(iMA(NULL,0,MA2,MA2_SHIFT,MA2_MODE, MA2_PRICE,i));} and these conditions if(Ma1 > Ma2) SetCandleColor(1,i); else if(Ma1 < Ma2) SetCandleColor(2,i); and rewrite them into your EA with the same inputs from the candle indicator and either paste in the MA extern functions from the candle indicator or hard code them straight into these lines of code. double Ma1 = iMA(NULL,0,MA1,MA1_SHIFT,MA1_MODE, MA1_PRICE,0); double Ma2 = iMA(NULL,0,MA2,MA2_SHIFT,MA2_MODE, MA2_PRICE,0); if(Ma1 > Ma2) BUY if(Ma1 < Ma2) SELL
__________________
My Disadvantage is that I am not a Trained Programmer - My Advantage is that I am not a Trained Programmer. http://cjatradingtools.com/ Last edited by cja; 08-07-2008 at 06:00 AM. |
|
|||
|
Tester versus live trading
Yes I havd live trading enabled and allows DLL calls etc as required for all EA's to trade live. That is why I stated that that section is set up correctly.
However my EA runs in the tester and is very good, but I must be missing some function call; that enables trading that has nothing to do with the EA setup from Metatrader interface. Is there any Function call in the code preamble necessary to enable live trading? It is really weird... it works in the tester but not in Live trading and yes I have a smiley face. |
|
|||
|
Quote:
FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM NEW: video presentation of the Probability Meter ... 24hrs action on the website |
|
|||
|
Quote:
|
|
|||
|
I have a problem with this EA. It does close a position when a candle closes, and does not close when to 2 Ma's cross with each other. For example if i have a long candle when two MA's cross, i loose some pips because it closes position later than two MA's cross each other. Maybe someone can solve this ?
//+------------------------------------------------------------------+ //| Closer on mas.mq4 | //| Shingami | //| Forex Trading Software: Forex Trading Platform MetaTrader 4 | //+------------------------------------------------------------------+ #property copyright "Shinigami© 2007" #property link "Shini1984@gmail.com" #define ORDER_ID 2016 extern int MA1.period =0; extern int MA1.shift=0; extern int MA1.method=0; extern int MA1.price=0; extern int MA2.period=0; extern int MA2.shift=0; extern int MA2.method=0; extern int MA2.price=0; int start() { if(CheckMACross()==1) CloseOrders(); return(0); } int CheckMACross() { if(iMA(Symbol(),0,MA1.period,MA1.shift,MA1.method, MA1.price,2)<iMA(Symbol(),0,MA2.period, MA2.shift,MA2.method,MA2.price,2)) { if(iMA(Symbol(),0,MA1.period,MA1.shift,MA1.method, MA1.price,1)>=iMA(Symbol(),0,MA2.period,MA2.shift, MA2.method,MA2.price,1)) return(1); } else if(iMA(Symbol(),0,MA1.period ,MA1.shift,MA1.method,MA1.price,2)>iMA(Symbol(),0, MA2.period,MA2.shift,MA2.method,MA2.price,2)) { if(iMA(Symbol(),0,MA1.period,MA1.shift,MA1.method, MA1.price,1)<=iMA(Symbol(),0,MA2.period,MA2.shift, MA2.method, MA2.price,1)) return(1); } else return(0); } int CloseOrders() { for(int i=0;i<OrdersTotal();i++) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); //if(OrderMagicNumber()!=MagicNumber) //continue; if(OrderSymbol()!=Symbol()) continue; if(OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),Bid,3); if(OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,3); } return(0); } Last edited by Berkis; 08-08-2008 at 01:59 PM. |
![]() |
| Bookmarks |
| Tags |
| automated close order, close, eas, forex, learn mql4, learn mql4 video, mql4 learning, OrderCloseBy, profit, reach, secure profit function, T101_v1.11_orest_IBFXm.mq4, learning mql4 |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Learning Cycles For New Traders | Dan7974 | General Discussion | 350 | 01-18-2008 07:04 PM |
| Learning to code for autotrading | GoatT | Metatrader Programming | 8 | 01-10-2007 09:55 PM |
| Self learning expert | mrtools | Expert Advisors - Metatrader 4 | 32 | 10-22-2006 06:29 PM |