You didn't post a topic yet. Let us show you how to make your first topic and upload your favorite forex robot. Guide me

Skip to forum content


Login with Facebook Username:  Password:  Login  |  Register

Registered members can download over 5000 forex robots and over 8000 forex indicators!

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 2
Please rate this topic
Current rating: 0
Votes: 0

Topic: Stoch_TP_TS_V3103.mq4 Source Code!

Stoch_TP_TS_V3103.mq4 Source Code!

//+------------------------------------------------------------------+
//|                                            Stoch_TP_TS_V3103.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""

int time = 0;
extern int minut = 56;
extern int orders = 2;
extern int trailstop = 15;
extern int start = 95;
extern int stolos = 830;
extern int diff = 175;
extern int sign = 0;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   double lot;
   if (AccountBalance() >= orders*diff*1000) lot=100;
   else if (AccountBalance() < orders*diff)
   {  Print("Not enough money!");   }
   else lot=(MathRound(AccountBalance()/(orders*diff))/10);
   
   if ((time != TimeHour(TimeCurrent())) && (minut == TimeMinute(TimeCurrent())))
   {
      time = TimeHour(TimeCurrent());
      double base = iStochastic(Symbol(),Period(),5,3,3,0,0,0,0);
      double signal = iStochastic(Symbol(),Period(),5,3,3,0,0,1,0);
      int ticket;
      int total=OrdersTotal();
      if(total<orders)
      {
         if (((signal - base) >= sign) && (base <= 80) && (base >= 20))
         {
            while(true)
            {
               ticket=OrderSend(Symbol(),OP_SELL,lot,Bid,3,0,0,"SELL",0,0,Red);
               if(ticket<=0) Print("Error = ",GetLastError());
               else { Print("ticket = ",ticket); break; }
               //---- 10 seconds wait
               Sleep(10000);
            }
            PlaySound("alert2.wav");
         }
         else if (((base - signal) > sign) && (base <= 80) && (base >= 20))
         {
            while(true)
            {
               ticket=OrderSend(Symbol(),OP_BUY,lot,Ask,3,0,0,"BUY",0,0,Green);
               if(ticket<=0) Print("Error = ",GetLastError());
               else { Print("ticket = ",ticket); break; }
               //---- 10 seconds wait
               Sleep(10000);
            }
            PlaySound("alert2.wav");
         }
      }
   }
   for (int i = 0; i < OrdersTotal(); i++) 
    {
        OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
        double TSTP = trailstop * Point;
        double STLO = stolos * Point;
        double TKPR = (start + 2 * start) * Point;

        if (OrderComment() == "BUY")
        {
            if ((Bid - OrderOpenPrice()) >= start * Point)
            {
                if (OrderStopLoss() < (Bid - TSTP))
                {
                    OrderModify(OrderTicket(), OrderOpenPrice(), Bid - TSTP, 0, Red);
                    PlaySound("expert.wav");
                }
            }
            else if (OrderStopLoss() == 0)
            {
               OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice() - STLO, OrderOpenPrice() + TKPR,0);
            }
        }
        else if (OrderComment() == "SELL")
        {
            if ((OrderOpenPrice() - Ask) >= start * Point)
            {
                if (OrderStopLoss() > (Ask + TSTP))
                {
                    OrderModify(OrderTicket(), OrderOpenPrice(), Ask + TSTP, 0, Red);
                    PlaySound("expert.wav");
                }
            }
            else if (OrderStopLoss() == 0)
            {
               OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice() + STLO, OrderOpenPrice() - TKPR,0);
            }
        }
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Share

 

 

 

Re: Stoch_TP_TS_V3103.mq4 Source Code!

Thank for sharing your code.
i m newbies for the EA programming.

Share

Posts: 2

Pages 1

You must login or register to post a reply

Last Posts

  • 20/01: RULES OF TRADING
  • 20/01: Best martingale ea
  • 20/01: Ironfx is a total garbage. (SCAM)
  • 20/01: Hedging EA's here
  • 20/01: low latency vps
  • 20/01: AutoProfit set
  • 19/01: ASSAR v8
  • 19/01: 2000 pips daily
  • 19/01: Super Signal Scalping Profit Statement
  • 19/01: Rabbit3 £100 start Zero to Hero Updated EA
  • 19/01: Ilan Expert Advisor for Metatrader 4
  • 19/01: high profit EA
  • 19/01: Trade-Arbitrage EA
  • 19/01: Differences between types of EAs
  • 19/01: Scalper_v5 (free)
  • 19/01: COPY TRADES
  • 19/01: FxAli from WWI
  • 19/01: Profitable Scalper EA Free download!!
  • 19/01: spartan bolt V6
  • 19/01: WayGrow EA 1.7
  • Hot Topics

  • Profitable Scalper EA Free download!! (598)
  • Scalper_v5 (free) (534)
  • A highly profitable Ea (347)
  • spartan bolt V6 (319)
  • ASSAR v8 (297)
  • Assar_03_EA (296)
  • 2000 pips daily (286)
  • Trade-Arbitrage EA (192)
  • Fap Turbo Expert Advisor is now absolutely free! (174)
  • forex hacked pro (166)
  • Forex Earth Robot (157)
  • xmt scalper (151)
  • Rabbit3 £100 start Zero to Hero Updated EA (139)
  • Forex Math EA free for Mt4 (133)
  • Fracture 7.4.0 (132)
  • high profit EA (130)
  • EA SmartAssTrade. (128)
  • New to forex? (127)
  • Super Signal Scalping Profit Statement (126)
  • Ilan Expert Advisor for Metatrader 4 (120)
  • Popular Topics

  • Profitable Scalper EA Free download!! (47749)
  • Scalper_v5 (free) (20967)
  • A highly profitable Ea (20682)
  • Assar_03_EA (13479)
  • ASSAR v8 (12955)
  • spartan bolt V6 (12876)
  • Trade-Arbitrage EA (11156)
  • xmt scalper (10960)
  • 2000 pips daily (10855)
  • Super Signal Scalping Profit Statement (9884)
  • Fap Turbo Expert Advisor is now absolutely free! (9839)
  • forex hacked pro (9774)
  • Forex Earth Robot (9479)
  • Forex Math EA free for Mt4 (8896)
  • Ilan Expert Advisor for Metatrader 4 (8737)
  • WayGrow EA 1.7 (8639)
  • Fracture 7.4.0 (8564)
  • Rabbit3 £100 start Zero to Hero Updated EA (8094)
  • high profit EA (7979)
  • EA SmartAssTrade. (7961)

  • Forum statistics

    • Total number of registered users: 7,842
    • Newest registered user: karimixp99
    • Total number of topics: 14,087
    • Total number of posts: 27,944

     


    By posting a message, you automatically agree to the Forum Rules and Privacy Policy.