Download MetaTrader 5
To add comments, please log in or register
No time to learn MQL5? Order your application from a developer!
Trololo Tromberino
73
Trololo Tromberino 2015.12.11 10:08 

Hello here is my next question^^

This time this could interest more people: Renkocharts are very easy to handle for beginners and seem to be a pretty save thing in slow markets.

However i wanted to try my own EA´s on a renko because i think that could be interesting aswell.

But sadly this is not possible: I use the RenkoChart EA build by Tim Welch: https://www.mql5.com/en/code/11739

When i open the offline Chart everything is fine and seems to work. I can adjust my templates etc.

But when i add my EA´s they just don´t work. On the normal Chart they work pretty well and also on other offline Charts. But on this offline Chart produced by the ea it´s just not working.

Well my question now: Is this Problem caused by the fact that i already use an ea on one Chart and mt4 doesn´t want me to use another one, even if it´s technically on another Chart (offline)?

Or is there something i have to add on my ea to make it work? Or can i just use an Renko Indicator and not an Renko EA?


Would be very, very helpful


Best regards

Ttromberino

whroeder1
13627
whroeder1 2015.12.11 15:04  
  1. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
  2. We can't see your broken code; there are no mind readers here.
Trololo Tromberino
73
Trololo Tromberino 2015.12.11 18:34  
WHRoeder:
  1. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
  2. We can't see your broken code; there are no mind readers here.

Well there is not much to say about my code, but here you have it:

//+------------------------------------------------------------------+
//|                                                        rengo.mq4 |
//|                                                Korbinian Gabriel |
//|                                                                - |
//+------------------------------------------------------------------+
#property copyright "Korbinian Gabriel"
#property link      "-"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
extern double Lots = 0.2;
extern string Start = "09:15"; // Start the EA
extern string Ende = "17:00";  // Finish the EA
int OldBar = 0;


bool dc_long(){
   return Close[3] < Open[3] && Close[2] > Open[2] && Close[1] > Open[1] && Close[2] < Close[1];
   }

bool dc_short(){
   return Close[3] > Open[3] && Close[2] < Open[2] && Close[1] < Open[1] && Close[2] > Close[1];
   }

//--- condition 2: Docht muss 1,5 groß sein wie eine Kerze.
bool sc_long(){
   return Low[1] < Close[2] && Close[1] > Open[1]; //Achtung es fehlt condition, dass es wirklich 1,5 und nicht 1,3 sind.
   }

bool sc_short(){
   return High[1] > Close[2] && Close[1] < Open[1]; //Achtung es fehlt condition, dass es wirklich 1,5 und nicht 1,3 sind.
   }

//Stoplossdefinition:
double sl_long = Open[2];
double sl_short = Open[2];
  
int OnInit()
  {
//---


//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
int start()
{
//--- 1 Check per bar
   if(OldBar != Bars)
   {
      if (TimeCurrent() >= StrToTime(TimeToStr(TimeCurrent(), TIME_DATE) + " " + Start) && TimeCurrent() <= StrToTime(TimeToStr(TimeCurrent(), TIME_DATE) + " " + Ende)) {
         
         int ticket_long;
         int ticket_short;
         int total = OrdersTotal();
         sl_long = Open[2];
         sl_short = Open[2];
         
         if(OrdersTotal() == 0 && dc_long() == true)
         {
            ticket_long=OrderSend(Symbol(),OP_BUY,Lots,Ask,10,sl_long,0, "My Order",16384,0,Green);   
            if(ticket_long < 0) {
               Print("OrderSend ",ticket_long," long with error #",GetLastError());
            } else{
               Print("OrderSend ",ticket_long," long successfully #" + string(ticket_long));
            }

         }
         
         if(OrdersTotal() == 0 && dc_short() == true)
         {
            ticket_short=OrderSend(Symbol(),OP_SELL,Lots,Bid,10,sl_short,0, "My Order",16384,0,Red);   
            if(ticket_short < 0) {
               Print("OrderSend ",ticket_short," short with error #",GetLastError());
            } else{
               Print("OrderSend ",ticket_short," short successfully #" + string(ticket_short));
            }
         }   
              
         for(int i=0;i<=total-1;i++) {
            if(OrdersTotal() > 0 && OrderSelect(i,SELECT_BY_POS) && OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderCloseTime()==0  ){
               if(OrderStopLoss()< sl_long) {
                  bool ordermodify = OrderModify(OrderTicket(),OrderOpenPrice(),sl_long,0,0,Green);
                  if(ordermodify = false)
                     Print("LONG Stoploss von Order",OrderTicket()," wurde NICHT nachgezogen",GetLastError());
                  else
                     Print("LONG Stoploss von Order",OrderTicket()," wurde nachgezogen");
               }
            }
         }
            
         for(int i=0;i<=total-1;i++) {
            if(OrdersTotal() > 0 && OrderSelect(i,SELECT_BY_POS) && OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderCloseTime()==0  ){
               if(OrderStopLoss()< sl_short) {
                  bool ordermodify = OrderModify(OrderTicket(),OrderOpenPrice(),sl_short,0,0,Green);
                  if(ordermodify = false)
                     Print("SHORT Stoploss von Order",OrderTicket()," wurde NICHT nachgezogen",GetLastError());
                  else
                     Print("SHORT Stoploss von Order",OrderTicket()," wurde nachgezogen");
               }
            }
         }
         
      }
      OldBar = Bars;
   }
   return(0);
}
//+------------------------------------------------------------------+

It´s nothing special and i want it to use on renko charts. But somehow no ea works when i add it on rengo charts. As is said, i use the rengo chart from Tim Welch (Link above).


Hope you can help me out.

Ovo Cz
2951
Ovo Cz 2015.12.11 19:27  
Try other Renko script, there are plenty of them.
whroeder1
13627
whroeder1 2015.12.12 12:47  
TTromberino: But sadly this is not possible: I use the RenkoChart EA build by Tim Welch: https://www.mql5.com/en/code/11739
FileWriteInteger(HstHandle, PrevTime, LONG_VALUE);        // Time
        FileWriteDouble(HstHandle, CurOpen, DOUBLE_VALUE);             // Open
        FileWriteDouble(HstHandle, CurLow, DOUBLE_VALUE);        // Low
        FileWriteDouble(HstHandle, CurHigh, DOUBLE_VALUE);        // High
        FileWriteDouble(HstHandle, CurClose, DOUBLE_VALUE);        // Close
        FileWriteDouble(HstHandle, CurVolume, DOUBLE_VALUE);        // Volume     
That generator has not been updated for build 600.
struct MqlRates

  {
   datetime time;         // Period start time
   double   open;         // Open price
   double   high;         // The highest price of the period
   double   low;          // The lowest price of the period
   double   close;        // Close price
   long     tick_volume;  // Tick volume
   int      spread;       // Spread
   long     real_volume;  // Trade volume

  };

/
To add comments, please log in or register