| 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 (2) | Thread Tools | Display Modes |
|
||||
|
Quote:
__________________
You need proffesional mql coder? Contact me! I will help you! ........................................ http://www.fxservice.eu/ ........................................ |
|
||||
|
EA is complete but does not run
Ralph & Kalenzo, thanks for your reponse a couple days ago.
I have completed the EA and it clears the compiler with no errors and loads successfully in the stategy tester, but does not produce any results. Any thoughts? Here is the entire code, but first let me say I have no illusions as whether this EA can produce a profit. I am simply trying to write an EA start to finish get it to run. This EA is a modified version of the Blessing strategy with a d'Alembert money managemenet system instead of the Martingale MM. extern int Rungsi = 20; extern int slippage = 5; extern double Lotsi = 0.1; extern int stoploss = 25; extern int takeprofit = 25; extern string Note1 = "Valid TimeFrames: 1, 5, 15, 30, 60, 240, 1440, 10080, 43200"; int Wcnt = 0; int Lcnt = 0; int cnt = 0; double Clotsi = 0; double Lucnt = 0; bool EnableTrading = true; double PipValue = 0; string text2 = ""; string text = ""; //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ int init() { return(0); } //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ int start() { if(OrdersTotal()<1){ OrderSend(Symbol(),OP_BUY,Lotsi,Ask,slippage,stopl oss,takeprofit,0,0,0,Blue); Clotsi = Lotsi; return(0); } else OrderSelect(1,SELECT_BY_POS,MODE_TRADES); if(Bid >= OrderOpenPrice()+Rungsi*Point){ OrderClose(1,Clotsi,Bid,slippage,Blue); if(Lcnt==0){ OrderSend(Symbol(),OP_BUY,Lotsi,Ask,slippage,stopl oss,takeprofit,0,0,0,Blue); return(0); } else Wcnt=Wcnt+1; if(Wcnt==1){ Clotsi=Lcnt; OrderSend(Symbol(),OP_BUY,Clotsi,Ask,slippage,stop loss,takeprofit,0,0,0,Blue); Lucnt=0; return(0); } else Lcnt=0; Wcnt=0; OrderSend(Symbol(),OP_BUY,Lotsi,Ask,slippage,stopl oss,takeprofit,0,0,0,Blue); return(0); } else if(Bid <= OrderOpenPrice()-Rungsi*Point){ OrderClose(1,Clotsi,Bid,slippage,Blue); Lucnt=Lucnt+Clotsi; Lcnt=Lcnt+1; OrderSend(Symbol(),OP_BUY,Clotsi,Ask,slippage,stop loss,takeprofit,0,0,0,Blue); return(0); } else return(0); } |
|
||||
|
Quote:
Ralph, Thank you very much for your patient and polite responses. I know the mistakes were really dumb ones. As a beginner I didn't know where to begin when the EA passed muster with compiler, and the Strategy Tester said it loaded successfully, but would not produce any results. Prior to posting my request I had actually tried something close (but obviously not correct) to what is in the manual. That earlier version passed muster with the compiler, but the Stategy Tester rejected the OrderSend syntax. So I looked at the OrderSend statement in the EA that I had made some mods to, to see its syntax. That's where I derived the bad syntax. What I now understand is the author of that EA prefined "stoploss" and "takeprofit" using the correct syntax before the OrderSend statement is executed. Have some programming experience with Fortran and Basic, but the MQL4 language is challenging for me right now. Thanks again for your succint and polite responses. They were most helpful. Raft BTY Now that the EA runs I can see I have a couple logic errors in the EA as well, but I'll figure those out now that I have the syntax issues behind me. |
|
|||
|
need help with EA coversion
hi everyone,
thumbs up to you guy for having a heart to help. i am trying to convert a straddle ea to script can anyone give me an idea how to go abt it? thanks in advance
__________________
it's all abt the news |
|
|||
|
some kind of script that monitors the trades until it reaches a preset profit so that as soon as the trades starts coming down after exceeding the preset profit it must close all trades on that currency. But if the profit goes up beyond the preset , it should trail the preset amount not individual trade.
|
![]() |
| Bookmarks |
| Tags |
| histogram, forex |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
|
||||
| Posted By | For | Type | Date | |
| OzFx System:) - Page 639 | This thread | Refback | 06-21-2008 09:53 PM | |
| Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart | This thread | Refback | 12-08-2007 11:46 AM | |