Forex King Scalper (EA)

Live Forex Chart

Currency
Rates
EUR / USD
1.11685
USD / JPY
107.915
GBP / USD
1.2455
USD / CHF
0.95126
USD / CAD
1.40235
EUR / JPY
120.524
AUD / USD
0.61652

CG Sponsors




ekadec

Freshie
Joined
Mar 7, 2013
Messages
1
Reaction score
0
Points
3
saya baru bertemu forum ni, mungkin bisa dapat banyak ilmu..
 
Sponsored Post

zabidin2

Active Member
Joined
Jul 4, 2011
Messages
1,470
Reaction score
100
Points
33
Copy&Paste sume2 kat bawah nih sebagai fail *.mq4... Sukati korang la nak letak nama apa kat tanda '*' tuh... :D

mungkin ada error sbb ada spaces " ". rapat2kan lik pastu compile... GOOD LUCK!!! :)cgrock:)cgrock:)cgrock

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]
Ade error.
 

Attachments

jamesphuc89

Freshie
Joined
Jul 2, 2015
Messages
43
Reaction score
0
Points
6
Hi Zabidin2,

1. What is the minimum account balance needed to use this ea?

2. So far, is this ea PROFITABLE ? How many % profit per month can it make?

3. Can you please kindly share your profitable set files for this ea?

Thanks a lot

James
 

ddeeen

Junior Member
Joined
May 11, 2013
Messages
61
Reaction score
1
Points
11
nice share sir. let me try use those scalper.
Is those EA for 4 digits broker like Liteforex, and FBS or not?
 

jamesphuc89

Freshie
Joined
Jul 2, 2015
Messages
43
Reaction score
0
Points
6
Hi all,

Anybody can have profitable preset file for this ea?

Please kindly share your good set files here.

Thanks a lot

James
 
Sponsored Post
Top
Log in Register