What is this error ?
|
|||
|
Hello,
I've tryed to create a simple xpert with help of zero code, but when i put it in expert folder, it doesn't load, and generates this error: 41;22;1;46;unexpected token - token ")" 41;22;1;59;semicolon expected - token ")" The expert is a simple EMA crossing system. Any help on this? Thanks, Sulz |
![]() |
code
|
|||
|
Hello,
Please find code included under: /*[[ Name := EMA 5_34 cross Author := Sulz Link := Coded_by_FXFisherman_ZeroCode_@www.fxfisherman.com Lots := 1 Stop Loss := 20 Take Profit := 0 Trailing Stop := 20 ]]*/ defines: Slippage(3); defines: ; var: cnt(0),IsBuying(False),IsSelling(False),IsClosing( False),RealTP(0),RealSL(0); var: ma1_1(0),ma1_0(0),ma2_1(0),ma2_0(0); // Check for invalid bars and takeprofit If Bars<200 then Exit; // Calculate indicators' value ma1_1 = iMAEx(34,MODE_EMA,0,PRICE_CLOSE,1); ma1_0 = iMAEx(34,MODE_EMA,0,PRICE_CLOSE,0); ma2_1 = iMAEx(5,MODE_EMA,0,PRICE_CLOSE,1); ma2_0 = iMAEx(5,MODE_EMA,0,PRICE_CLOSE,0); // Check for BUY, SELL, and CLOSE signal IsBuying = (ma2_0 > ma1_0); IsSelling = (ma2_0 < ); IsClosing = (ma2_0 == ma1_0); // Control open trades for cnt=1 to TotalTrades { // Control only market trades not entry order if OrderValue(cnt,VAL_TYPE)<=OP_SELL and OrderValue(cnt,VAL_SYMBOL)=Symbol then { // Check for close signal for bought trade If OrderValue(cnt,VAL_TYPE)=OP_BUY then { If IsSelling or IsClosing then { // Close bought trade CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(c nt,VAL_LOTS),Bid,3,Violet); Alert("EMA 5_34 cross: Closing BUY order."); }; // Check trailing stop If TrailingStop>0 then { If (Bid-OrderValue(cnt,VAL_OPENPRICE))>(Point*TrailingStop ) then { If OrderValue(cnt,VAL_STOPLOSS)<(Bid-Point*TrailingStop) then { // Modify trailing stop ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue( cnt,VAL_OPENPRICE), Bid-Point*TrailingStop,OrderValue(cnt,VAL_TAKEPROFIT), Red); }; }; }; } else { // Check sold trade for close signal If IsBuying or IsClosing then { CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(c nt,VAL_LOTS),Ask,3,Violet); Alert("EMA 5_34 cross: Closing SELL order."); }; // Control trailing stop If TrailingStop>0 then { If (OrderValue(cnt,VAL_OPENPRICE)-Ask)>(Point*TrailingStop) then { If OrderValue(cnt,VAL_STOPLOSS)=0 or OrderValue(cnt,VAL_STOPLOSS)>(Ask+Point*TrailingSt op) then { ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue( cnt,VAL_OPENPRICE), Ask+Point*TrailingStop,OrderValue(cnt,VAL_TAKEPROF IT),Red); }; }; }; }; }; }; // If there is no open trade If TotalTrades<1 then { // If we have enough money for 1 lot If FreeMargin<1000 then Exit; // Check for BUY entry signal If IsBuying and IsSelling=False and IsClosing=False then { // Buy If StopLoss>0 then { RealSL=Ask-StopLoss*Point; } If TakeProfit>0 then { RealTP=Ask+TakeProfit*Point; } SetOrder(OP_BUY,Lots,Ask, Slippage,RealSL,RealTP,RED); Alert("EMA 5_34 cross: Buying"); }; // Check for SELL entry signal If IsSelling and IsBuying=False and IsClosing=False then { // Sell If StopLoss>0 then { RealSL=Bid+StopLoss*Point; } If TakeProfit>0 then { RealTP=Bid-TakeProfit*Point; } SetOrder(OP_SELL,Lots,Bid,Slippage,RealSL,RealTP,R ED); Alert("EMA 5_34 cross: Selling"); }; }; //-------------- Coded by FXFisherman ZeroCode v1.0.2014.30845 |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MT3 API for VB.net and C# | scorpion | Tools / Utilities | 55 | 09-02-2006 06:02 PM |
| Stochastic system - Error | tradetrade | Trading Systems | 11 | 07-26-2006 07:14 AM |
| coding error? | Scicronys | MetaTrader and ZeroCode | 1 | 11-07-2005 07:24 AM |
All times are GMT. The time now is 06:33 AM.
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now











Linear Mode

