Opening, closing in Expert Advisor generated by MQL5 Wizard - page 8

 
Andy:

Yes, you can see it by right-clicking on m_base_price (go to definition).

Please advise me on the scheme - I really need it!

In the example of calculating the signal from two modules to open a position taken only two signals of different strength and no third with a greater force.


On the scheme:

Last man standing

as I understand it, there is no selection of the stronger signal. There can only be a signal from one market pattern (using SignalMA.mqh as an example - pattern "0" is a service, auxiliary element).

 
Andy:

In what way is pattern 0 an auxiliary element?


It has the main sense:

  • for BUY: Close[1] is located above MA[1] - so if pattern #2 or pattern #3 is not triggered, this will be the signal to open BUY, because the price of Close Bar #1 has closed BEFORE the MA indicator - i.e. in our direction, in the positive direction.
  • for SELL by analogy

 
Andy:
Yes, but when pattern #1 is triggered it always outbids it with its signal strength (80 vs. 10) - why?

No, it does not, because pattern #1 and pattern #0 are separate by condition - they do not occur together in the SignalMA.mqh module:

//+------------------------------------------------------------------+
//| "Voting" that price will grow.                                   |
//+------------------------------------------------------------------+
int CSignalMA::LongCondition(void)
  {
   int result=0;
   int idx   =StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
   if(DiffCloseMA(idx)<0.0)
     {
      //--- the close price is below the indicator
      if(IS_PATTERN_USAGE(1) && DiffOpenMA(idx)>0.0 && DiffMA(idx)>0.0)
        {
         //--- the open price is above the indicator (i.e. there was an intersection), but the indicator is directed upwards
         result=m_pattern_1;
         //--- consider that this is an unformed "piercing" and suggest to enter the market at the current price
         m_base_price=0.0;
        }
     }
   else

There is pattern #1 and NO pattern #0.

 
Andy:

By the way, Vladimir, do you think it is necessary to track the slope of the moving average (rising or falling) if a candle is above the MA, for example, when creating a signal module by MA, or is it non-critical?


Who knows :) . We have to write and check ... On all symbols, on all timeframes ...

 
Andy:

But below, under else it is there and always goes together 0 and 1 (checked against your pattern marker file).


I don't believe it. There is no such thing in the code as a pattern #0 and a pattern #1 in one run. Show me a piece of code.

 

And when you try to combine LongCondition and ShortCondition in the same sentence, do you not get cognitive dissonance?

 
Andy:

See the three lines at the bottom of the cursor



I will have to repeat it:

Forum on trading, automated trading systems and trading strategy testing

Opening, closing in Expert Advisor generated by MQL5 Wizard

Vladimir Karputov, 2017.10.05 14:56

And when you try to combineLongCondition and ShortCondition in one phrase- don't you get cognitive dissonance?


 
Andy:

The longcondition is a 0 pattern and the shortcondition is a 1 pattern, so what's not to understand?


That's what I want to understand. You speak first:

Forum on trading, automated trading systems and trading strategy testing

Opening, closing in Expert Advisor generated by MQL5 Wizard

Andy, 2017.10.05 14:34

Yes, but when pattern 1 is triggered it always overrides it with its signal strength (80 vs 10) - why?

And then, why do you suddenly mix in two different signals: LongCondition and ShortCondition.


Please sort out what LongCondition and ShortCondition mean and why one condition can work and the other can't (won't result in opening a position).


Added: I am out of the discussion until tomorrow. I hope that instead of texting, you will still comprehend the work of the signals module.

 
Vladimir Karputov:
Comments not related to"Summing signals from Moving Average from different timeframes" have been moved to this thread.

Vladimir, where did all my posts from this thread go?

 
Andy:

Vladimir, where have all my posts from this thread gone?

I have no idea. You've probably deleted them since they're gone.

Reason: