Compare yours with mine:
PHP Code:
//*------------------------------------------------------------------------------------------------------------------*\ // This MQL is automatically generated by FXFisherman ZeroCode v1.0.2041.38510 (www.fxfisherman.com) // // FXFisherman ZeroCode is provided free of charge, and, therefore, on an "as is" basis, without warranty of any kind. // In any case, the authors will not be responsible or liable for ANY LOSSES caused by using of this software. // //*--------------------------------------------PLEASE DO NOT REMOVE THIS HEADER--------------------------------------*/ /*[[ Name := 10 minutes Author := TradeCurrency.ca, Scorpion Link := Coded_by_FXFisherman_ZeroCode_@www.fxfisherman.com Lots := 1 Stop Loss := 25 Take Profit := 60 Trailing Stop := 0 ]]*/ defines: Slippage(3); defines: ; var: cnt(0),IsBuying(False),IsSelling(False),IsClosing(False),RealTP(0),RealSL(0); var: macd5sig_1(0),macd5his_0(0),macd5sig_0(0),macd5his_1(0),rsi4_1(0),rsi4_0(0),stoc3d_1(0),stoc3d_0(0),stoc3k_1(0),stoc3k_0(0),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 macd5sig_1 = iMACDEx(24,52,18,PRICE_CLOSE,MODE_SIGNAL,1); macd5his_0 = iMACDEx(24,52,18,PRICE_CLOSE,MODE_MAIN,0); macd5sig_0 = iMACDEx(24,52,18,PRICE_CLOSE,MODE_SIGNAL,0); macd5his_1 = iMACDEx(24,52,18,PRICE_CLOSE,MODE_MAIN,1); rsi4_1 = iRSI(28,1); rsi4_0 = iRSI(28,0); stoc3d_1 = iSTO(10,6,6,MODE_SMA,MODE_SIGNAL,1); stoc3d_0 = iSTO(10,6,6,MODE_SMA,MODE_SIGNAL,0); stoc3k_1 = iSTO(10,6,6,MODE_SMA,MODE_MAIN,1); stoc3k_0 = iSTO(10,6,6,MODE_SMA,MODE_MAIN,0); ma1_1 = iMAEx(10,MODE_LWMA,0,PRICE_CLOSE,1); ma1_0 = iMAEx(10,MODE_LWMA,0,PRICE_CLOSE,0); ma2_1 = iMAEx(20,MODE_SMA,0,PRICE_CLOSE,1); ma2_0 = iMAEx(20,MODE_SMA,0,PRICE_CLOSE,0); // Check for BUY, SELL, and CLOSE signal IsBuying = (ma1_0 > ma2_0) and (stoc3k_0 > stoc3d_0) and (rsi4_0 > 50) and (macd5his_0 > 0); IsSelling = (ma1_0 < ma2_0) and (stoc3k_0 < stoc3d_0) and (rsi4_0 < 50) and (macd5his_0 < 0); IsClosing = False; // 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(cnt,VAL_LOTS),Bid,3,Violet); Alert("10 minutes: 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(cnt,VAL_LOTS),Ask,3,Violet); Alert("10 minutes: 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*TrailingStop) then { ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_OPENPRICE), Ask+Point*TrailingStop,OrderValue(cnt,VAL_TAKEPROFIT),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("10 minutes: 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,RED); Alert("10 minutes: Selling"); }; }; //-------------- Coded by FXFisherman ZeroCode v1.0.2041.38510
Last edited by scorpion : 11-04-2005 at 11:51 AM.
|