Coding help - page 732

 
mntiwana:

Dearest MLADEN

Thanks for guide help.it is clear now,thanks.

and how we do remove this kind warnings ? ..... and if leave those warnings as is/are,do it effect the functionality of the code.

"check operator precedence for possible error; use parentheses to clarify precedence"

what to add and or do with ?

regards


That is far more dangerous problem

Since the logical operators precedence is not the same as in the older builds of mt4, each and every such condition must be checked and re-checked to work exactly the same as before, and in may cases that means a complete recoding

 
mladen:
Why are you comparing value with a handle? Handle is a handle - it can not be compared to value

hi,

lol.... yes is discovered this yesterday because the correct variable to get the indicator is

 if (Hilo_cl[0]>Hilo_ma[0]) { 

 
mladen:

That is far more dangerous problem

Since the logical operators precedence is not the same as in the older builds of mt4, each and every such condition must be checked and re-checked to work exactly the same as before, and in may cases that means a complete recoding

Dearest MLADEN

Much appreciations for your detailed explanation,thanks.

actually i want clean this EA code for using as MODEL FRAME because it having a lot of order controlling and managing options and features ..... opening/closing trades,especially dynamic trailing,time and news filter and so on.

so that lately i can use our TSD tools with (i am not going to use it as it is)

can you manage time to clean the code from warnings and some possible upgrade faster working ability.

regards

 
mntiwana:

Dearest MLADEN

Much appreciations for your detailed explanation,thanks.

actually i want clean this EA code for using as MODEL FRAME because it having a lot of order controlling and managing options and features ..... opening/closing trades,especially dynamic trailing,time and news filter and so on.

so that lately i can use our TSD tools with (i am not going to use it as it is)

can you manage time to clean the code from warnings and some possible upgrade faster working ability.

regards

maybe :)

if(weekfilter)if((nstarthour<=nendhour && (TimeCurrent()<tstart || TimeCurrent()>tend)) || (nstarthour>nendhour && TimeCurrent()<tstart && TimeCurrent()>tend))return(true);
 

hi mr mladen:

could you make MTF of it

best regard

Files:
 

Hello Mr. Mntiwana, many thanks for your response as regards the modification of the candle time indicator I requested here. The indicator which you gave me is far better than the one I asked to be modified. That is to be expected knowing that Mr. Mladen coded it -  a pure work of genius. I'm very grateful.


Mr. Mladen, much thanks for your response, too. I appreciate all the time and selfless efforts you put in helping people. I tried modifying the indicator with the object property alignment but it was just not working for me so I have opted to use the one you coded. Like I said, it is far much better than the one I asked you to help modify. Many thanks for your time.

 
oguz:

Dear @mladen,

Attached ea have too much russian settings. and I find it hard to understand them.

I am very satisfied if you make them russian to English.

Thank you. 

You could always try Google Translate for any phrase or sentence that you want translated.                           
 
Anyway:

maybe :)

if(weekfilter)if((nstarthour<=nendhour && (TimeCurrent()<tstart || TimeCurrent()>tend)) || (nstarthour>nendhour && TimeCurrent()<tstart && TimeCurrent()>tend))return(true);

Hi Anyway

   Thanks,i did as your advised and it removed 1 of that warning,what about the rest of 6 warning,how to remove those too.

(check operator precedence for possible error; use parentheses to clarify precedence)

i am not sure if we are doing as we should do it properly or just guessing around :)

regards


 
mntiwana:

Hi Anyway

   Thanks,i did as your advised and it removed 1 of that warning,what about the rest of 6 warning,how to remove those too.

(check operator precedence for possible error; use parentheses to clarify precedence)

i am not sure if we are doing as we should do it properly or just guessing around :)

regards


:)  

You give it a try: (changed it with Notepad, so not sure)

      if(totalbuy>0){if(((addposmode==0 && Ask<=lastbuyopenprice-pipstep*pt*MathPow(pipstepfactor,totalbuy))
      || (addposmode==1 && Ask>=lastbuyopenprice+pipstep*pt*MathPow(pipstepfactor,totalbuy)))
      && (eoobexceptaddpos || (eoobexceptaddpos==false && barstatus)))buy=true;}
      if(totalsell>0){if(((addposmode==0 && Bid>=lastsellopenprice+pipstep*pt*MathPow(pipstepfactor,totalsell))
      || (addposmode==1 && Bid<=lastsellopenprice-pipstep*pt*MathPow(pipstepfactor,totalsell)))
      && (eoobexceptaddpos || (eoobexceptaddpos==false && barstatus)))sell=true;}
 

Hi Pro-Coders,

I wonder if someone could help,

I would like to my EA open a Buy Trade and close an existing Sell Trade on trend change.

It does it, but only when it took profit. When the trend changes while the position is still

open, it runs in StopLoss. (See picture). Sometimes is it working and sometimes not.

What could I improve? 

 

if(trendNow!=trendPrev)
         if(trendNow>0 && (NLD1>NLD2) && RSIfilter>55)
           {
            OpenBuy_  =true;
            CloseSell_=true;
           }
         else
         if(trendPrev>0 && (NLD1<NLD2) && RSIfilter<45)
           {
            OpenSell_=true;
            CloseBuy_=true;  
          }
Reason: