Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Copy&Paste sume2 kat bawah nih sebagai fail *.mq4... Sukati korang la nak letak nama apa kat tanda '*' tuh...
mungkin ada error sbb ada spaces " ". rapat2kan lik pastu compile... GOOD LUCK!!!
Code:[COLOR="Blue"]//------------------ #property copyright "" #property link "" #include <stdlib.mqh> extern double InitialLot=0.1; extern int TP=15; extern int SL=15; extern bool UseMultiplyLot=true; extern int LotMultiplier=2; extern bool UseDailyTarget=true; extern double DailyTarget=30; //usd extern int MinuteAssignHiLo=15; extern int MinuteResetHiLo=55; extern int MinuteStart=15; extern int MinuteFinish=54; extern int PipDifferentLow=1; extern int PipDifferentHigh=2; extern bool UseTimeRange=true; extern int HoursStartTrade=09; extern int MinuteStartTrade=00; extern int HoursFinishTrade=17; extern int MinuteFinishTrade=59; extern bool UseBasketProfit=false; extern double BasketProfit=10; extern double BasketLoss=15; double high15=0; double low15=0; int HourDone[24]; string mySymbol; double tempTimeStartTrade, tempTimeFinishTrade, tempCurrentTime; double Slippage=2; string TradeComment="TF15 HiLo Scalping"; int MagicNumber=12345678; double ask, bid, point, tempLot, TargetAccountBalance, tempTargetAccountBalance; // user input int init() { if (UseTimeRange==true) { tempTimeStartTrade=(HoursStartTrade*100)+MinuteStartTrade; tempTimeFinishTrade=(HoursFinishTrade*100)+MinuteFinishTrade; ** if (UseDailyTarget==true) {TargetAccountBalance=AccountBalance()+DailyTarget;** for (int cv=0; cv<24; cv++) HourDone[cv]=false; //initiate tempLot=InitialLot; mySymbol=Symbol(); Print("Init happened ",Hour()+":"+Minute()); Comment("EA Scalping"); ** //+----------------+ //| Custom DE-init | //+----------------+ // Called ONCE when EA is removed from chart int deinit() { Print("DE-Init happened ",Hour()+":"+Minute()); Comment(""); ** int start() { tempTargetAccountBalance=TargetAccountBalance; if (Hour()==00 && Minute()==00) { TargetAccountBalance=0; if (UseDailyTarget==true) {TargetAccountBalance=AccountBalance()+DailyTarget;** for (int cv=0; cv<24; cv++) {HourDone[cv]=false;** //initiate Comment("EA reset at "+Hour()+":"+Minute()+". Previous target="+DoubleToStr(tempTargetAccountBalance,2)); return; ** if ( (UseBasketProfit==true) && OrdersTotal()>0 ) FunctionBasketProfit(); if (UseDailyTarget==true) { if (AccountBalance()>=TargetAccountBalance) { Comment("Daily target achieved! Final Total USD"+DoubleToStr(AccountBalance(),2)); return;** ** if (UseTimeRange==true && TradeTime()==false) {Comment("EA is OFF... NOT trade time");return;** if (HourDone[Hour()]==true || OrdersTotal()>0 ) return; //assign high and low if (Minute()==MinuteAssignHiLo) { high15=iHigh(mySymbol,15,1); low15=iLow(mySymbol,15,1); ** if (Minute()==MinuteResetHiLo) { high15=0; low15=0;** Comment("Hour:"+Hour()+", High 0-15 = "+DoubleToStr(high15,4)+", Low 0-15="+DoubleToStr(low15,4)+"/Closing target=USD"+DoubleToStr(TargetAccountBalance,2)); if (Minute()>=MinuteStart && Minute()<=MinuteFinish && HourDone[Hour()]==false) { if (Bid>=high15+(PipDifferentLow*point) && Bid<=high15+(PipDifferentHigh*point)) { if (UseMultiplyLot==true) {CheckHitTP_SL();** OpenPos("Buy", InitialLot); HourDone[Hour()]=true; high15=0; low15=0; //reset hilo Comment("Open position for Hour ="+Hour()+" is done. Closing target=USD"+DoubleToStr(TargetAccountBalance,2)); InitialLot=tempLot; ** if (Ask<=low15-(PipDifferentLow*point) && Ask>=low15-(PipDifferentHigh*point)) { if (UseMultiplyLot==true) {CheckHitTP_SL();** OpenPos("Sell", InitialLot); HourDone[Hour()]=true; high15=0; low15=0;//reset hilo Comment("Open position for Hour ="+Hour()+" is done. Closing target=USD"+DoubleToStr(TargetAccountBalance,2)); InitialLot=tempLot; ** ** return; ** // start() //check last closed position for multiply lots void CheckHitTP_SL() { if (OrdersHistoryTotal()==0) return; OrderSelect(OrdersHistoryTotal()-1, SELECT_BY_POS, MODE_HISTORY); if (OrderProfit()>0) {InitialLot=tempLot;** if (OrderProfit()<0) {InitialLot=OrderLots()*LotMultiplier;** return; ** void OpenPos(string Trade, double Lots) { int gle=0; int ticket=0; int loopcount; loopcount=0; bid=MarketInfo(mySymbol,MODE_BID); ask=MarketInfo(mySymbol,MODE_ASK); point=MarketInfo(mySymbol,MODE_POINT); double TPBuy=0; double SLBuy=0; double TPSell=0; double SLSell=0; if(TP>0){TPBuy=ask+TP*point;TPSell=bid-TP*point;** if(SL>0){SLBuy=ask-SL*point;SLSell=bid+SL*point;** while(true) { if (Trade=="Buy") { ticket=OrderSend(mySymbol,OP_BUY,Lots,Ask,Slippage ,SLBuy,TPBuy,TradeComment,MagicNumber ,White); ** if (Trade=="Sell") { ticket=OrderSend(mySymbol,OP_SELL,Lots,Bid,Slippage,SLSell,TPSell,TradeComment,MagicNumber,Red); ** gle=GetLastError(); if(gle==0) { if (Trade=="Buy") Print("BUY PLACED Ticket="+ticket+" Ask="+ask+" Lots="+Lots); if (Trade=="Sell") Print("SELL PLACED Ticket="+ticket+" Bid="+bid+" Lots="+Lots); break; ** else { if (Trade=="Buy") Print("-----ERROR----- Placing BUY order: Lots="+Lots+" Bid="+bid+" Ask="+ask+" ticket="+ticket+" Err="+gle+" "+ErrorDescription(gle)); if (Trade=="Sell") Print("-----ERROR----- placing SELL order: Lots="+Lots+" SL="+" Bid="+bid+" Ask="+ask+" ticket="+ticket+" Err="+gle+" "+ErrorDescription(gle)); //RefreshRates(); // give up after 10 tries (~5 seconds) loopcount++; if(loopcount>1) { if (Trade=="Buy") Print("-----ERROR----- Giving up on placing BUY order"); if (Trade=="Sell") Print("-----ERROR----- Giving up on placing SELL order"); return(gle); ** ** ** **//void OpenPos bool TradeTime() { tempCurrentTime=(Hour()*100)+Minute(); if(tempTimeStartTrade<tempTimeFinishTrade) { if (tempCurrentTime>=tempTimeStartTrade && tempCurrentTime<=tempTimeFinishTrade) return(true); ** else if(tempTimeStartTrade>tempTimeFinishTrade) { if (tempCurrentTime>=tempTimeStartTrade || tempCurrentTime<=tempTimeFinishTrade) return(true); ** return(false); ** int FunctionBasketProfit() { int cnt; double myAsk; double myBid; double currBasket=0; //Basket profit or loss currBasket=AccountEquity()-AccountBalance(); //Comment("Profit/Loss = ",currBasket); if(currBasket>=BasketProfit || currBasket<=(BasketLoss*(-1)) ) { // CLOSE order if profit target made while (OrdersTotal()>0) //enforce close all trade { for(cnt=OrdersTotal(); cnt>=0; cnt--) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if( OrderType()==OP_BUY || OrderType()==OP_SELL ) { mySymbol=OrderSymbol(); if(OrderType()==OP_BUY) { myBid=MarketInfo(mySymbol,MODE_BID); OrderClose(OrderTicket(),OrderLots(),myBid,Slippage,White); ** // if BUY if(OrderType()==OP_SELL) { myAsk=MarketInfo(mySymbol,MODE_ASK); OrderClose(OrderTicket(),OrderLots(),myAsk,Slippage,Red); ** //if SELL ** // if(OrderSymbol) ** // for **//while Ordertotal()>0 ** //currBasket ** // //-----------[/COLOR]


Hi all,
Anybody can have profitable preset file for this ea?
Please kindly share your good set files here.
Thanks a lot
James