Useful features from KimIV - page 93

 

Ibiss писал(а) >>

'clModifyBuy' - variable not defined

'clModifySell' - variable not defined
'ti' - variable already defined

What to do?(.

1. You have defined ti twice yourself.

2. define yourself global variables 'clModifyBuy ' and ' clModifySell' (colours of order modification icons).

 

'clModifyBuy' - variable not defined

'clModifySell' - variable not defined

I removed them from the top and the error is gone.

I had to remove the lower int to make the ti disappear! All thanks :)

 

I can't figure out why Kim's trawl isn't working, missed a couple of positions at night...good thing there's a demo:)

Everything is on in the settings...

What could be the problem?

 
KimIV >> :

The iBarOfDayReal() function.

This function returns the actual bar number from the beginning of the day. The bars are numbered from one, i.e. the bar with the shortest opening time in a given day will be number one, the next bar will be number two, etc.

Hello

I am trying to write an indicator using a function, I need to draw a line through a certain bar, which I calculate by subtracting the bars from the total number of bars from the beginning of the day. I can't draw it, it doesn't work. What am I doing wrong?

//+------------------------------------------------------------------+
//|                                                       PIPS-1.mq4 |
//|                                                               AK |
//|                                              http://wwwСАЙТА.net |
//+------------------------------------------------------------------+
#property copyright "AK"
#property link      "http://wwwСАЙТА.net"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0, ExtMapBuffer1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   iBarOfDayReal(NULL,0,0);
   ExtMapBuffer1[0]=High[Bars-( iBarOfDayReal(NULL,0,0))];
 
   return(0);
  }
//+------------------------------------------------------------------+
int iBarOfDayReal(string sy="", int tf=0, datetime dt=0) {
  if ( sy=="" || sy=="0") sy=Symbol();
  if ( tf<=0) tf=Period();
  if ( dt<=0) dt=TimeCurrent();
  if ( tf>PERIOD_D1) {
    Print("iBarOfDayReal(): Таймфрейм должен быть меньше или равен D1");
    return(0);
  }

  int cd=TimeDay( dt);                       // текущий день месяца
  int nb=iBarShift( sy, tf, dt, False);      // номер текущего бара
  int bd=0;                                 // номер бара от начала суток

  while(TimeDay(iTime( sy, tf, nb))== cd) {
    nb++;
    bd++;
  }

  return( bd);
}
 
Ibiss >> :

I can't figure out why Kim's trawl isn't working, missed a couple of positions at night...good thing there's a demo:)

It's all on in the settings...

What's the problem?

Maybe you have some kind of contest demo account?

It happens that in contest demo accounts, the operation of EAs is "hardware" prohibited on the server.

 
rid >> :

Maybe you have a contest demo account or something?

It happens, that on the contest demo accounts the work of Expert Advisors is "hardware" forbidden on the server.


Nah, just a regular demo on Alpari.

Maybe there's a code with the correct Kimiv insertion lying around somewhere).

 

Please tell me how to change the lot for an already installed BUYSTOP, is there a separate function for this ?

 
trek писал(а) >>

Can you please tell me how to change the lot of an already installed BUYSTOP, is there a special function for that ?

Remove and put new one (I mean order, not size)

 

like this?

for(c=0;c<OrdersTotal();c++){//1
if(OrderSelect(c,SELECT_BY_POS,MODE_TRADES)==true){//2
if(OrderType()==OP_BUY && OrderSymbol()==Symbol()){//3
for(a=0;a<OrdersTotal();a++){//4
if(OrderSelect(a,SELECT_BY_POS, MODE_TRADES)==true){//5
if(OrderType()==OP_SELLSTOP && OrderSymbol()==Symbol()){//6
lots=OrderOpenPrice()
sl=OrderStopLoss();
tp=OrderTakeProfit();
ticket=OrderDelete(OrderTicket());
//Comment("\n","\n","\n", "lots- ", lots,"\n", "sl- ",sl,"\n", "tp- ",tp,"\n", "total- ",OrdersTotal());
if(tickets<0){Alert(GetLastError());}
Lots1=Lots1*2;
if(OrdersTotal()<1){ticket=OrderSend(Symbol(),OP_SELLSTOP,Lots1,lots,3,sl,tp, "1",444,0,Red);}
if(tickets<0){Alert(GetLastError());}
Comment(OrdersTotal());

} //6
}//5
}//4
}//3
}//2
}//1

wrote it like this, it immediately puts orders for me until the money runs out.

 
khorosh >> :
Need an equity trawl...

"Everybody needs a boat..." (c) I've been crawling on Igor's lap on his site, it didn't help :)) He advised me to use my brains, but where could I get them? There were many suggestions, but trawl on the basis of kimov, IMHO, would be the best option. Maybe you can do it?

Reason: