[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 231

 
PapaYozh:


zero emotion =( still nothing =(
 
CLAIN:

no emotions =( still nothing =(


You get a bad feeling, as if I owe you something.

Analyse your CheckTicket(), what does it put in your ticket?

And in general, use the Print(...) function and analyze the log.

 
CLAIN:

zero emotion =( still nothing =(

I don't know your logic behind the function. Just in case, I suggest you check if this is what you want.

Are you applying the iMACD correctly and don't you also need a Signal Line?

 
PapaYozh:


There's a bad feeling, as if I owe you something.

Analyse your CheckTicket(), what does it put in your ticket?

In general, use the Print(...) function and analyse the log.


You don't owe me anything... I'm sorry if you feel that way... it's just that i've had so much trouble with her already...............
 

I think checkticket has nothing to do with it, because if I just change signal_MACD to true, the trades close fine, and the search is narrowed down only to the size of the function:

 bool signal_MACD() 
  { 
    bool signal_MACD = false; 
    double tmp = iMACD(Symbol(),TF,fast_ema,slow_ema,signal_period,PRICE_CLOSE,MODE_MAIN,0); 
    for(int i=1;i<=5;i++) 
    { 
       if(NormalizeDouble(iMACD(Symbol(),TF,fast_ema,slow_ema,signal_period,PRICE_CLOSE,MODE_MAIN,0)*tmp,4)<0.0) 
       { 
          signal_MACD = true; 
          break; 
       }        
    } 
    return(signal_MACD);
  } 

somewhere around here it doesn't want to take true......... I just don't work well with the for loop, so I don't know where to put return here

 
CLAIN:

I think checkticket has nothing to do with it, because if I just change signal_MACD to true, the trades close fine, and the search is narrowed down only to the size of the function:

somewhere around here it doesn't want to take true......... I just don't work well with the for loop, so I don't know where to put return here

And what is the difference between double tmp and NormalizeDouble(iMACD(Symbol(),TF,fast_ema,slow_ema,signal_period,PRICE_CLOSE,MODE_MAIN,0)?

Multiplying them will always be greater than zero.

I think so))

(-) * (-) = +

(+) * (+) = +

 

my logic is very simple... if the MACD indicator is on one side of 0 for no more than 5 minutes, then trade.... that's it...

by the way if

bool signal_MACD() 
  { 
    bool signal_MACD = true; 
    double tmp = iMACD(Symbol(),TF,fast_ema,slow_ema,signal_period,PRICE_CLOSE,MODE_MAIN,0); 
    for(int i=1;i<=5;i++) 
    { 
       if(NormalizeDouble(iMACD(Symbol(),TF,fast_ema,slow_ema,signal_period,PRICE_CLOSE,MODE_MAIN,0)*tmp,4)<0.0) 
       { 
          signal_MACD = true; 
          break; 
       }        
    } 
    return(signal_MACD);
  } 

... in the 3rd line "false" to "true", deals will be done all the time, it means I wrote the correct deal logic and code, and all that's left is a for and return clause

let's finish it please

 
DhP:

What is the difference between double tmp andNormalizeDouble(iMACD(Symbol(),TF,fast_ema,slow_ema,signal_period,PRICE_CLOSE,MODE_MAIN,0)?

Multiplying them will always be greater than zero.

I think so))

(-) * (-) = +

(+) * (+) = +


will not always be greater than 0... Just if the MACD crossed 0 on one of the ticks, there will be (+)*(-) - which will indicate a cross... well... my logic =) not necessarily correct, of course )
 
CLAIN:

my logic is very simple... if the MACD indicator is on one side of 0 for no more than 5 minutes, then trade.... that's it...

By the way, if

... in the 3rd line "false" to "true", deals will be done all the time, it means I wrote the correct deal logic and code, and all that's left is a for and return clause

let's finish it please


They will be concluded all the time because the function will always return "true"
 
CLAIN:

my logic is very simple... if the MACD indicator is on one side of 0 for no more than 5 minutes, then trade.... that's it...

by the way if

... in the 3rd line "false" to "true", deals will be done all the time, it means I wrote the correct deal logic and code, and all that's left is a for and return clause

Let's finish it please.

Maybe there should be(i) in the line? .....

if(NormalizeDouble(iMACD(Symbol(),TF,fast_ema,slow_ema,signal_period,PRICE_CLOSE,MODE_MAIN,i).

Reason: