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

  • 18/01: stop reversal.ex4 stop reversal.ex4 Forex indicator free download
  • 18/01: forex trading guide
  • 18/01: how to download a fil
  • 18/01: EA_PSar_002B_v1 EA
  • 18/01: 3 MA crossover
  • 18/01: RUBBERBANDS_3 EA
  • 18/01: hello
  • 18/01: Are all EAs discussed here operational?
  • 18/01: Why choose EUR/USD?
  • 18/01: A highly profitable Ea
  • 18/01: stop loss
  • 18/01: No deposit bonus brokers
  • 18/01: Has anyone heard of this system before can't find it anymore?
  • 18/01: Hello From USA.
  • 18/01: Pairs trading
  • 18/01: one year with FXCM and no problems
  • 18/01: The PZ Day Trading indicator has been specially designed
  • 18/01: how to win forex
  • 18/01: Profitable Scalper EA Free download!!
  • 18/01: RULES OF TRADING
  • Hot Topics

  • Profitable Scalper EA Free download!! (597)
  • Scalper_v5 (free) (532)
  • A highly profitable Ea (345)
  • spartan bolt V6 (316)
  • Assar_03_EA (296)
  • ASSAR v8 (293)
  • 2000 pips daily (283)
  • Trade-Arbitrage EA (189)
  • 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 (138)
  • Forex Math EA free for Mt4 (133)
  • Fracture 7.4.0 (132)
  • EA SmartAssTrade. (128)
  • high profit EA (128)
  • New to forex? (127)
  • Super Signal Scalping Profit Statement (125)
  • Ilan Expert Advisor for Metatrader 4 (117)
  • Popular Topics

  • Profitable Scalper EA Free download!! (47557)
  • Scalper_v5 (free) (20811)
  • A highly profitable Ea (20483)
  • Assar_03_EA (13389)
  • ASSAR v8 (12714)
  • spartan bolt V6 (12699)
  • Trade-Arbitrage EA (11067)
  • xmt scalper (10905)
  • 2000 pips daily (10727)
  • Super Signal Scalping Profit Statement (9798)
  • Fap Turbo Expert Advisor is now absolutely free! (9774)
  • forex hacked pro (9707)
  • Forex Earth Robot (9426)
  • Forex Math EA free for Mt4 (8842)
  • Ilan Expert Advisor for Metatrader 4 (8667)
  • WayGrow EA 1.7 (8587)
  • Fracture 7.4.0 (8518)
  • Rabbit3 £100 start Zero to Hero Updated EA (8048)
  • EA SmartAssTrade. (7928)
  • high profit EA (7920)

  • Forum statistics

    • Total number of registered users: 7,816
    • Newest registered user: vlavaden
    • Total number of topics: 14,080
    • Total number of posts: 27,867

     


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