/*-----------------------------+ | | | Shared by www.Aptrafx.com | | | +------------------------------*/ //+------------------------------------------------------------------+ //| Copyright 2005, Gordago Software Corp. | //| http://www.gordago.com/ | //| Done by: Osama Ben Shaban, Email: o_shaban@hotmail.com | //| The Method is presented by Ganbah | //+------------------------------------------------------------------+ #property copyright "Copyright 2005, Gordago Software Corp." #property link "http://www.gordago.com" #define MAGIC 943448 extern double lStopLoss = 22; extern double sStopLoss = 22; extern double lTakeProfit = 10; extern double sTakeProfit = 10; extern color clOpenBuy = Blue; extern color clCloseBuy = Aqua; extern color clOpenSell = Red; extern color clCloseSell = Violet; extern color clModiBuy = Blue; extern color clModiSell = Red; extern string Name_Expert = "Generate from Gordago"; extern int Slippage = 1; extern bool UseSound = True; extern string NameFileSound = "alert.wav"; extern double Lots = 0.30; void deinit() { Comment(""); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start(){ if(Bars<100){ Print("bars less than 100"); return(0); } if(lStopLoss<10){ Print("StopLoss less than 10"); return(0); } if(lTakeProfit<10){ Print("TakeProfit less than 10"); return(0); } if(sStopLoss<10){ Print("StopLoss less than 10"); return(0); } if(sTakeProfit<10){ Print("TakeProfit less than 10"); return(0); } double diRSI0=iRSI(NULL,60,3,PRICE_CLOSE,0); double diRSI1=iRSI(NULL,60,3,PRICE_CLOSE,0); if(AccountFreeMargin()<(1000*Lots)){ Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } if (!ExistPositions()){ if ((diRSI0<20)){ OpenBuy(); return(0); } if ((diRSI1>80)){ OpenSell(); return(0); } } return (0); } bool ExistPositions() { for (int i=0; i<OrdersTotal(); i++) { if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC) { return(True); } } } return(false); } void ModifyStopLoss(double ldStopLoss) { bool fm; fm = OrderModify(OrderTicket(),OrderOpenPrice(),ldStopLoss,OrderTakeProfit(),0,CLR_NONE); if (fm && UseSound) PlaySound(NameFileSound); } void OpenBuy() { double ldLot, ldStop, ldTake; string lsComm; ldLot = GetSizeLot(); ldStop = GetStopLossBuy(); ldTake = GetTakeProfitBuy(); lsComm = GetCommentForOrder(); OrderSend(Symbol(),OP_BUY,ldLot,Ask,Slippage,ldStop,ldTake,lsComm,MAGIC,0,clOpenBuy); if (UseSound) PlaySound(NameFileSound); } void OpenSell() { double ldLot, ldStop, ldTake; string lsComm; ldLot = GetSizeLot(); ldStop = GetStopLossSell(); ldTake = GetTakeProfitSell(); lsComm = GetCommentForOrder(); OrderSend(Symbol(),OP_SELL,ldLot,Bid,Slippage,ldStop,ldTake,lsComm,MAGIC,0,clOpenSell); if (UseSound) PlaySound(NameFileSound); } string GetCommentForOrder() { return(Name_Expert); } double GetSizeLot() { return(Lots); } double GetStopLossBuy() { return (Bid-lStopLoss*Point);} double GetStopLossSell() { return(Ask+sStopLoss*Point); } double GetTakeProfitBuy() { return(Ask+lTakeProfit*Point); } double GetTakeProfitSell() { return(Bid-sTakeProfit*Point); }
Sample
Analysis
Market Information Used:
Indicator Curves created:
Indicators Used:
Relative strength index
Custom Indicators Used:
Order Management characteristics:
Checks for the total of open orders
It can change open orders parameters, due to possible stepping strategy
It automatically opens orders when conditions are reached
Other Features:
It plays sound alerts