Comment thresholdopen and thresholclose make ea work well

 

I was trying to understand why my simple ea generated by wizard sends order every bar. After comment these lines:

   ExtExpert.InitSignal(signal);

   //signal.ThresholdOpen(Signal_ThresholdOpen);

   //signal.ThresholdClose(Signal_ThresholdClose);

   signal.PriceLevel(Signal_PriceLevel);

   signal.StopLevel(Signal_StopLevel);

   signal.TakeLevel(Signal_TakeLevel);

   signal.Expiration(Signal_Expiration);

 

it worked :) 

 
jsampaio123:

I was trying to understand why my simple ea generated by wizard sends order every bar. After comment these lines:

   ExtExpert.InitSignal(signal);

   //signal.ThresholdOpen(Signal_ThresholdOpen);

   //signal.ThresholdClose(Signal_ThresholdClose);

   signal.PriceLevel(Signal_PriceLevel);

   signal.StopLevel(Signal_StopLevel);

   signal.TakeLevel(Signal_TakeLevel);

   signal.Expiration(Signal_Expiration);

 

it worked :) 

And without commenting these lines, it doesn't work ?
 
angevoyageur:
And without commenting these lines, it doesn't work ?

Not like the ea should. Every new bar the ea send a order. It should do that only when a clear signal from a class signal match buy or send signal. With these two parameters coomented, it works fine.

I was reading about that and these two parameters are about "voting", making a possible order. But, in fact, these parameters make the ea execute the order. I've change the parameters values to prove my theory. In 0, it execute every order. In 100, it doens't execute any order. Now the best choice still keep them commented. That's what i'm doing.

 

Regards. 

 
jsampaio123:

Not like the ea should. Every new bar the ea send a order. It should do that only when a clear signal from a class signal match buy or send signal. With these two parameters coomented, it works fine.

I was reading about that and these two parameters are about "voting", making a possible order. But, in fact, these parameters make the ea execute the order. I've change the parameters values to prove my theory. In 0, it execute every order. In 100, it doens't execute any order. Now the best choice still keep them commented. That's what i'm doing.

 

Regards. 

If you comment these lines, you let the default values for both threshold, these values are respectively 50 and 100.

//+------------------------------------------------------------------+
//| Constructor                                                      |
//+------------------------------------------------------------------+
CExpertSignal::CExpertSignal(void) : m_base_price(0.0),
                                     m_general(-1),          // no "main" signal
                                     m_weight(1.0),
                                     m_patterns_usage(-1),   // all models are used
                                     m_ignore(0),            // all additional filters are used
                                     m_invert(0),
                                     m_threshold_open(50),
                                     m_threshold_close(100),
                                     m_price_level(0.0),
                                     m_stop_level(0.0),
                                     m_take_level(0.0),
                                     m_expiration(0)
  {
  }
 
angevoyageur:

If you comment these lines, you let the default values for both threshold, these values are respectively 50 and 100.

Yeap ! :) But this is the construct, the header file. I do not modify any thing into it. Just my style to develop :). I keep my header files safe. I prefer create one then modify the default :)

 

Regards.