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();
}

Replies
.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
Hi, email will be active only in this month (see in profil)
@mindbreaker

mindbreaker
21 Mar 2016, 08:34
This post was removed by moderator.
@mindbreaker