Coding help - page 724

 
mladen:

Try like this (this should be the whole code replacing the upper code):

      if(trendNow!=trendPrev)
         if(trendNow>0 && (NLD1>NLD2) && (!RSI_on || (RSI_on && RSIfilter>51)))
           {
            OpenBuy_  =true;
            CloseSell_=true;
           }
         else
         if(trendPrev>0 && (NLD1<NLD2) && (!RSI_on || (RSI_on && RSIfilter<49)))
           {
            OpenSell_=true;
            CloseBuy_=true;
           }
Wow, cool! Thank you Mladen :-)
 

Hi Mladen,

I have a question about MT5.

I created a filter to "block avoid open the trade" and for this I need to check If have a opened operation or not..
If I don't have a opened operation it is the "entrace" (open) and I will use the filter.. but If I'm in the Exit (close) I will not use the filter.

to check if I'm in "open" or "close" stage.. 

I created this function to check If I'm have NO opened "operation" (result = -1 , entrace)   result=buy or close, =close)

but something is wrong or I'm using the wrong function to check this state?

Could you help me with this?

int OpenedOrders()
{
if(PositionSelect(_Symbol))
  {      
   if (PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY)
     {
      return(PositionGetInteger(POSITION_TYPE));

     }
   if(PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_SELL)
     {
      return(PositionGetInteger(POSITION_TYPE));
     }  
}
return(-1);//=-1 ==>no opened operation  
}
 

I think that this is correct? 

 

bool HaveOpenedOrders()
{
if(PositionSelect(_Symbol))
  {      
   if (PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY)
   return(true);
   if (PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_SELL)
   return (true);
  }
return(false); //false =no opened positions
}
 
baraozemo:

I think that this is correct? 

 

bool HaveOpenedOrders()
{
if(PositionSelect(_Symbol))
  {      
   if (PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY)
   return(true);
   if (PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_SELL)
   return (true);
  }
return(false); //false =no opened positions
}
Yes, this should be correct
 

Hi, @mladen.

Attached ea does not order for long periods of time. (For about a month!) I think this is not normal.

Are the codes problem?  

 

Thank you very much. 

Files:
 

HI MR MLADEN:

 

could you make A MTF DOJI CANDLE

 

MAKE MTF of indicator i attach

 

BEST REGARD 

Files:
 
oguz:

Hi, @mladen.

Attached ea does not order for long periods of time. (For about a month!) I think this is not normal.

Are the codes problem?  

 

Thank you very much. 

oguz

I would need the original (non-decompiled) source code to check it

 

mr mladen

please fix it

i use multi time frame

i turn on vertical line on all histogram

but only show one histogram vertical line

i need it show vertical line for all histogram

 

regard 

 

 
bilbao:

mr mladen

please fix it

i use multi time frame

i turn on vertical line on all histogram

but only show one histogram vertical line

i need it show vertical line for all histogram

 

regard 

 

Nothing to be fixed

Set the linesID parameter of each instance to unique value and then you can have as much instances as you wish


 
mladen:

Nothing to be fixed

Set the linesID parameter of each instance to unique value and then you can have as much instances as you wish


thanks a lot