Download MetaTrader 5

Experts: OpenTiks

To add comments, please log in or register
Interested in social trading? Read the article!
MetaQuotes Software Corp.
Moderator
181194
MetaQuotes Software Corp. 2009.01.13 07:05 

OpenTiks:

The indicatorless system based on the analysis of 4 previous bars.

Author: Maksim Zerkalov

MQL4 Comments
16319
MQL4 Comments 2009.01.13 15:49  

Hm, interesante idea.

MQL4 Comments
16319
MQL4 Comments 2009.01.13 17:52  

Great idea,

have checked it with live history data from various brokers and it works very well.

With additional MM and time sensitive settings it would be perfect.

Thank you so much.

Regards

bobby
129
bobby 2009.01.13 20:07  

Thanks for sharing this nice expert advisor. Here is a modified version with risk management.

MQL4 Comments
16319
MQL4 Comments 2009.01.14 04:21  

two problems:

1. no stoploss, dangerous

2. it judge the condition at the begin of bar, how do you know the High[0] in the begin of the bar, as my thought H[0]<= H[1] at the begin of a new bar

so I am wondering whether the ea uses the future data

Maksim Zerkalov
182
Maksim Zerkalov 2009.01.14 06:12  
hetachy:

two problems:

1. no stoploss, dangerous

2. it judge the condition at the begin of bar, how do you know the High[0] in the begin of the bar, as my thought H[0]<= H[1] at the begin of a new bar

so I am wondering whether the ea uses the future data


With English for me quite in any way, but
1. there is a parameter of Stoploss, specify the desired value and will you be proposed feet

2. in a code error in relation to description it is correct it would be to write down a condition:

if (Low[0]>Low[1]&&Low[1]>Low[2]&&Low[2]>Low[3]&&Open[0]>Open[1]&&Open[1]>Open[2]&&Open[2]>Open[3])
BuyOp=true;
if (High[0]<High[1]&&High[1]<High[2]&&High[2]<High[3]&&Open[0]<Open[1]&&Open[1]<Open[2]&&Open[2]<Open[3])
SellOp=true;

MQL4 Comments
16319
MQL4 Comments 2009.01.14 09:26  
zerkmax:
hetachy:

two problems:

1. no stoploss, dangerous

2. it judge the condition at the begin of bar, how do you know the High[0] in the begin of the bar, as my thought H[0]<= H[1] at the begin of a new bar

so I am wondering whether the ea uses the future data


With English for me quite in any way, but
1. there is a parameter of Stoploss, specify the desired value and will you be proposed feet

2. in a code error in relation to description it is correct it would be to write down a condition:

if (Low[0]>Low[1]&&Low[1]>Low[2]&&Low[2]>Low[3]&&Open[0]>Open[1]&&Open[1]>Open[2]&&Open[2]>Open[3])
BuyOp=true;
if (High[0]<High[1]&&High[1]<High[2]&&High[2]<High[3]&&Open[0]<Open[1]&&Open[1]<Open[2]&&Open[2]<Open[3])
SellOp=true;

hi,

I still have question as below

Since the ea only judge the condition in the begin of the bar, Low[0]>Low[1] (High[0]<High[1]) should always be right (assume no gap for current bar open). So can we remove Low[0]>Low[1] (High[0]<High[1]) and see the results?

I am not clear about how mt4 explain High[0] and Low[0], just wondering whether it will use the future data.

Thanks for your explaination and further discussion. ^_^

MQL4 Comments
16319
MQL4 Comments 2009.01.14 09:30  
zerkmax:
hetachy:

two problems:

1. no stoploss, dangerous

2. it judge the condition at the begin of bar, how do you know the High[0] in the begin of the bar, as my thought H[0]<= H[1] at the begin of a new bar

so I am wondering whether the ea uses the future data


With English for me quite in any way, but
1. there is a parameter of Stoploss, specify the desired value and will you be proposed feet

2. in a code error in relation to description it is correct it would be to write down a condition:

if (Low[0]>Low[1]&&Low[1]>Low[2]&&Low[2]>Low[3]&&Open[0]>Open[1]&&Open[1]>Open[2]&&Open[2]>Open[3])
BuyOp=true;
if (High[0]<High[1]&&High[1]<High[2]&&High[2]<High[3]&&Open[0]<Open[1]&&Open[1]<Open[2]&&Open[2]<Open[3])
SellOp=true;

One more suggestion, can we modify as below

if (Low[0]<Low[1]&&Low[1]<Low[2]&&Low[2]<Low[3]&&Open[0]<Open[1]&&Open[1]<Open[2]&&Open[2]<Open[3])
SellOp=true;
if (High[0]>High[1]&&High[1]>High[2]&&High[2]>High[3]&&Open[0]>Open[1]&&Open[1]>Open[2]&&Open[2]>Open[3])
BuyOp=true;

It may like a breakup, the difference is that this can not be only in the begin of the bar. Not sure the results.

MQL4 Comments
16319
MQL4 Comments 2009.01.16 04:55  
bberlin:

Great idea,

have checked it with live history data from various brokers and it works very well.

With additional MM and time sensitive settings it would be perfect.

Thank you so much.

Regards

I am a bit new to this I muct admit, however when i loaded the OpenTicks, I did not get these results at all. Is their something in the set up I am missing?

Thank you!

rale
6
rale 2009.01.17 15:11  

this is not but another version of adding up strategy

put random numbers for buying adn selling and you get the same results

//+------------------------------------------------------------------+
//|                                                     OpenTiks.mq4 |
//|                                        Copyright © 2008, ZerkMax |
//|                                                      zma@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, ZerkMax"
#property link      "zma@mail.ru"
extern int    Shift1          = 0;
extern int    Shift2          = 1;
extern int    Shift3          = 2;
extern int    Shift4          = 3;
extern int    TrailingStop   = 30;
extern int    StopLoss       = 0;
extern double Lots           = 0.1;
extern bool RiskManagement=false; //money management
extern double RiskPercent=10; //risk in percentage
extern int    magicnumber    = 777;
extern bool   PolLots        = true;
extern int    MaxOrders      =  1;
int prevtime;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   //risk management
   
   bool MM=RiskManagement;
   if(MM){if(RiskPercent<0.1||RiskPercent>100){Comment("Invalid Risk Value.");return(0);}
   else{Lots=MathFloor((AccountFreeMargin()*AccountLeverage()*RiskPercent*Point*100)/(Ask*MarketInfo(Symbol(),MODE_LOTSIZE)*
   MarketInfo(Symbol(),MODE_MINLOT)))*MarketInfo(Symbol(),MODE_MINLOT);}}
   if(MM==false){Lots=Lots;}
   int i=0;  
   int total = OrdersTotal();   
   for(i = 0; i <= total; i++) 
     {
      if(TrailingStop>0)  
       {                 
       OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
       if(OrderMagicNumber() == magicnumber) 
         {
         TrailingStairs(OrderTicket(),TrailingStop);
         }
       }
      }
bool BuyOp=false;
bool SellOp=false;
MathSrand(TimeLocal());
double r=MathRand()/32767;
//if (High[Shift1]>High[Shift2]&&High[Shift2]>High[Shift3]&&High[Shift3]>High[Shift4]&&Open[Shift1]>Open[Shift2]&&Open[Shift2]>Open[Shift3]&&Open[Shift3]>Open[Shift4]) BuyOp=true;
//if (High[Shift1]<High[Shift2]&&High[Shift2]<High[Shift3]&&High[Shift3]<High[Shift4]&&Open[Shift1]<Open[Shift2]&&Open[Shift2]<Open[Shift3]&&Open[Shift3]<Open[Shift4]) SellOp=true;
if (r>=0.5) BuyOp=true;
if (r<0.5) SellOp=true;
   if(Time[0] == prevtime) 
       return(0);
   prevtime = Time[0];
   if(!IsTradeAllowed()) 
     {
       prevtime = Time[1];
       return(0);
     }
   if (total < MaxOrders || MaxOrders == 0)
     {   
       if(BuyOp)
        { 
         if (StopLoss!=0)
          {
           OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-(StopLoss*Point),0,"OpenTiks_Buy",magicnumber,0,Green);
          }
         else
          {
           OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"OpenTiks_Buy",magicnumber,0,Green);
          }
        }
       if(SellOp)
        { 
         if (StopLoss!=0)
          {
           OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+(StopLoss*Point),0,"OpenTiks_Sell",magicnumber,0,Red);
          } 
         else 
          {
           OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"OpenTiks_Sell",magicnumber,0,Red);
          }
        }
      }
   
//----
   return(0);
  } 
//+------------------------------------------------------------------+
void TrailingStairs(int ticket,int trldistance)
   {
    int Spred=Ask - Bid;
    if (OrderType()==OP_BUY)
      {
       if((Bid-OrderOpenPrice())>(Point*trldistance))
         {
          if(OrderStopLoss()<Bid-Point*trldistance || (OrderStopLoss()==0))
            {
             OrderModify(ticket,OrderOpenPrice(),Bid-Point*trldistance,OrderTakeProfit(),0,Green);
             if (PolLots)
             if (NormalizeDouble(OrderLots()/2,2)>MarketInfo(Symbol(), MODE_MINLOT))
               {
               OrderClose(ticket,NormalizeDouble(OrderLots()/2,2),Ask,3,Green);
               }
             else
               {
               OrderClose(ticket,OrderLots(),Ask,3,Green);
               }
            }
         }
       }
     else
       {
        if((OrderOpenPrice()-Ask)>(Point*trldistance))
          {
           if((OrderStopLoss()>(Ask+Point*trldistance)) || (OrderStopLoss()==0))
             {
              OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*trldistance,OrderTakeProfit(),0,Red);
             if (PolLots)
             if (NormalizeDouble(OrderLots()/2,2)>MarketInfo(Symbol(), MODE_MINLOT))
               {
               OrderClose(ticket,NormalizeDouble(OrderLots()/2,2),Bid,3,Green);
               }
             else
               {
               OrderClose(ticket,OrderLots(),Bid,3,Green);
               }
             }
          }
        }
    }
lastman
49
lastman 2009.01.19 00:57  

Hii

Beautifull ea.... Thank you..

[URL=http://imageshack.us][IMG]http://img220.imageshack.us/img220/9898/eatikkgu8.jpg[/IMG][/URL]

https://c.mql5.com/3/34/my_phpgimage9eatikkgu8.jpg

123
To add comments, please log in or register