Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 441

 
niktron:
Hello! Could you please tell me how a condition looks like - if(first bullish candle's body length >100) Just doesn't work like this: if(Open[1]<Close[1]&&Close[1]-Open[1]>100)...Thanks in advance)))
if(Open[1]<Close[1] && High[1]-Low[1]>100*Point)
 
Mepkypuu:



Thank you very much!
 
r772ra:



Thank you so much...again I forgot to multiply by Point)))
 

Good afternoon!

I can't see the quotes on my chart. Please advise what is the reason?

Regards, Sergiy

 
price chart
 
zelya:

Good afternoon!

I can't see the quotes on my chart. Please advise what is the reason?

Sincerely, Sergiy.

More information, telepaths do not sit here, they sit further over there.

Z.I.: although I can assume that it's just a problematic android model, already discussed on the forum in the android thread.

 
The EA is placed on a tick chart. The test EA draws different coloured winding lines to buy, sell and close. It opens to the required side on
 Condition on _buy/condition _sale. It should close after the specified time.  I.e. it opened at 17-55-32. The specified time for the position to exist is t1=1 minute.
It means that the position should close at 17:56:32. 
 It practically opens and closes right after. The code does not work, it may be because of the tick chart or an error in the code.
2014.01.22 11:53:10 PriceBorder EURUSD,M2: Ex = 1390477981 2014.01.22 11:53:10 PriceBorder EURUSD,M2: curr = 1390477981 2014.01.22 11:53:10 PriceBorder EURUSD,M2: t = 1390477981
2014.01.22 11:52:59 PriceBorder EURUSD,M2: Ex = 1390477970 2014.01.22 11:52:59 PriceBorder EURUSD,M2: curr = 1390477970 2014.01.22 11:52:58 PriceBorder EURUSD,M2: t = 1390477969


 
extern int  t1  = 1; //Время выдержки в минутах
 bool op=false;
//+------------------------------------------------------------------+

int start()
  {   
//----                
            datetime  t;  
         
            //ExistPositions
            if(op)  
            {
               if(TimeCurrent()-t>t1*60)
                  Print("curr = ",TimeCurrent());
                  Print("Ex   = ",TimeCurrent()-t);
                  //ClosePositions  
                  SetVLine(Yellow);                  
                  op=false; 
            }
            else 
            {
               if(условие _на _покупку )
               { 
                  //OpenPosition                  
                  op=true;
                  SetVLine(Blue);                 
                  t=TimeCurrent();
                  Print("t = ",t);
               }
               if(условие_на_продажу)
               {
                  //OpenPosition
                  op=true;
                  SetVLine(Red);                 
                  t=TimeCurrent();                  
               }     
            }             
  //----
   return(0);
  }
 
evillive:

I'm not a telepath, the telepaths don't sit here, they sit further over there.

Z.I.: although I can assume that it's just a problematic android model, already discussed on the forum in the android thread.



Thanks!!!
 
splxgf:
Well if

None, just run in the tester for specific days.

Although if you need a frequent and large sample, it's easier to check the desired dates against the iTime of the day period.


Something like this?

int start()
{
if (
iTime(Symbol(), PERIOD_D1, 0) != StrToTime("2013.12.8")&&
iTime(Symbol(), PERIOD_D1, 0) != StrToTime("2014.01.15")&&
iTime(Symbol(), PERIOD_D1, 0) != StrToTime("2014.01.22")&&

..................

)
return(0);

...................

 
finkompot:


Something like this?

int start()
{
if (
iTime(Symbol(), PERIOD_D1, 0) != StrToTime("2013.12.8")&&
iTime(Symbol(), PERIOD_D1, 0) != StrToTime("2014.01.15")&&
iTime(Symbol(), PERIOD_D1, 0) != StrToTime("2014.01.22")&&

..................

)
return(0);

...................


It's an odd code. It's up to you, though.