fxono - very simple EA

Created at 16 Mar 2016, 22:20
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
mindbreaker's avatar

mindbreaker

Joined 19.07.2014

fxono - very simple EA
16 Mar 2016, 22:20


Hi, may be someone translate to cAlgo:

//|                                                        fxono.mq4 |
#property version   "1.0"
#property strict

#define MAGICMA  6666
//--- Inputs
input double Lot =1;
input int    sl = 50;
input int    tp = 50;
//+------------------------------------------------------------------+
//| Check for open order conditions                                  |
//+------------------------------------------------------------------+
void CheckForOpen()
  {
   double ma;
   int    res;
   ma= iOpen(NULL,PERIOD_W1,0);
   
   if(Open[1]<ma && Close[1]<ma)
     {
      res=OrderSend(Symbol(),OP_SELL,Lot,Bid,3,ma + sl*Point*10,Bid - tp*Point*10,"",MAGICMA,0,Red);
      return;
     }
//--- buy conditions
   if(Open[1]>ma && Close[1]>ma)
     {
      res=OrderSend(Symbol(),OP_BUY,Lot,Ask,3,ma - sl*Point*10,Ask + tp*Point*10,"",MAGICMA,0,Blue);
      return;
     }
  }
void OnTick()
{
   if(Bars<100)return;  
   if(OrdersTotal() == 0)CheckForOpen();
}

 


@mindbreaker
Replies

mindbreaker
21 Mar 2016, 08:34

This post was removed by moderator.


@mindbreaker

.ics
21 Mar 2016, 15:06 ( Updated at: 21 Dec 2023, 09:20 )

RE:

mindbreaker said:

Hi, may be someone translate to cAlgo:

//|                                                        fxono.mq4 |
#property version   "1.0"
#property strict

#define MAGICMA  6666
//--- Inputs
input double Lot =1;
input int    sl = 50;
input int    tp = 50;
//+------------------------------------------------------------------+
//| Check for open order conditions                                  |
//+------------------------------------------------------------------+
void CheckForOpen()
  {
   double ma;
   int    res;
   ma= iOpen(NULL,PERIOD_W1,0);
   
   if(Open[1]ma && Close[1]>ma)
     {
      res=OrderSend(Symbol(),OP_BUY,Lot,Ask,3,ma - sl*Point*10,Ask + tp*Point*10,"",MAGICMA,0,Blue);
      return;
     }
  }
void OnTick()
{
   if(Bars<100)return;  
   if(OrdersTotal() == 0)CheckForOpen();
}

 

mindbreaker, how can i get in contact with you?


@.ics

mindbreaker
21 Mar 2016, 16:16

Mail

Hi, email will be active only in this month (see in profil)

 


@mindbreaker

.ics
01 Apr 2016, 04:22

RE: Mail

mindbreaker said:

Hi, email will be active only in this month (see in profil)

 

Mindbreaker,

Sended you an email back.


@.ics