Writing free EAs - page 14

 
Vitaly Muzichenko:

Thank you very much!

But Kim writes convoluted functions, with lots of abbreviations... (

I seem to understand them... but I have no idea how to use them (

How can i use them to find the last signal, was it buy or sell?

Any tips?

 
Hi-Fi:

Thank you very much!

But Kim writes convoluted functions, with lots of abbreviations... (

I seem to understand them... but I have no idea how to use them (

How can i use them to find the last signal, was it buy or sell?

Can you tell me?

There is nothing complicated, you just have to fill it in and that's it

//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    sy - наименование инструмента   (NULL или "" - текущий символ)          |
//|    tf - таймфрейм                  (      0     - текущий ТФ)              |
//|    ne - номер экстремума           (      0     - последний)               |
//|    dp - ExtDepth                                                           |
//|    dv - ExtDeviation                                                       |
//|    bs - ExtBackstep                                                        |
//+----------------------------------------------------------------------------+
 void OnTick() {
  double res=GetExtremumZZPrice(Symbol(), 0, 0, 12, 5, 3);
}
 
Vitaly Muzichenko:

There is nothing complicated, you just need to fill it in and that's it

I have an Expert Advisor (I try to rewrite other EAs) without OnTick function and it does not see anything at all when it is enabled (it shows an empty chart in the Strategy Tester).

I take the GetExtremumZZZPrice variable from the function and set it in order opening conditions.

Do we have to give it a different name? Or maybe I do not understand something...(

 
Hi-Fi:

My EA (I am trying to rewrite other EAs) does not have "OnTick" function and when I enable it, it does not see anything at all (it shows an empty chart in the tester).

I have been using GetExtremumZZZPrice variable in function and adding it to order opening conditions.

Do we have to give it a different name? Or maybe I do not understand something...(

Read how to use custom functions, there is a lot of material here

 
Vitaly Muzichenko:

Read how to use custom functions, there is a lot of material here

Thanks for not sending. )))

The topic is "Writing free EAs", not "I'll give you a link to a manual"?

Please help me to correct ;))

P.S.

It's like a grandmother across the street

She asks to translate, and she pressed a button at a traffic light and went away/.

Files:
EA_ZZ.mq4  133 kb
 
Hi-Fi:

Thank you for not sending it. )))

The topic is "Writing free EAs" and not "I'll give you a link to a manual"?

Please help me to correct ;))

P.S.

It's like a grandmother across the street

She asks you to translate, and she pressed a button at a traffic light and left /.

i wanted to help - but it's better to rewrite everything - what did he do? - did you make a lot of money with him ? is it worth working on this strategy ?

dubll ZZ v4.0

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

your expert has 2000 lines - in today's world you can invest in 300 lines

 
SanAlex:

I wanted to help - but I'd rather rewrite the whole thing - what did he do? - have you made much money with him ? is it worth working with this strategy ?


I haven't worked with him yet, because he's not working.

I have not worked with him yet, because he does not work. I want to check the strategy and adjust the parameters.

I can do it manually, but I do not always see everything.

I would like to save this template, at least I understand it )))) There's only the top block of variables...

 
Hello! I have posted positions, correctly. As the analyst Igor Pirog wrote to me. It turned out 40 minutes later that I had made a mistake. The position was higher than it should have been. They now demand $320,000. What am I supposed to do? Help me return the money I invested and earned.
 
SanAlex:

I wanted to help - but I'd rather rewrite the whole thing - what did he do? - did you make much money with it ? is it worth working with this strategy ?

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

your expert has 2000 lines - in today's world you can invest in 300 lines

Would you like to rewrite it or not?

The conditions are simple, at crossing of Senkou_A and Senkou_B lines, looking back at ZigZag signal, an order is placed.

If the lower signal, then buy, if the higher one, then sell.

 
Hi-Fi:

Re-write or don't wait?

The conditions are simple, when Senkou_A and Senkou_B lines cross, looking back at the ZigZag signal, place an order.

If the lower signal, then buy, if the higher one, then sell.

I am just as much a writer as you are - I'm trying to learn myself.

this is where the arrows can be changed and will open the opposite

int IndicatorSignal()
  {
   int Sig=0;
//-----------------------Ichimoku---------------------------
   double Tenkan = iIchimoku(NULL, 0, tenkan, kijun, senkou, 1, 0);
   double Kijun =  iIchimoku(NULL, 0, tenkan, kijun, senkou, 2, 0);
   double Senkou_A = iIchimoku(NULL, 0, tenkan, kijun, senkou, 3, 26);
   double Senkou_B = iIchimoku(NULL, 0, tenkan, kijun, senkou, 4, 26);
   double Chikou = iIchimoku(NULL, 0, tenkan, kijun, senkou, 5, -26);
// ----------------------------------------------------------
// Stochastic--------------------------------------------------------------------
   double Stochastic_K = iStochastic(NULL, 0, kperiod, dperiod, slowing, method, apply, 0, 0);
   double Stochastic_S = iStochastic(NULL, 0, kperiod, dperiod, slowing, method, apply, 1, 0);
//--------------------------------------------------------------------------------
//Указываем Сигналы на закрытие BUY:
   /*
      if(
         GetExtremumZZPrice() >= Bid
      )
         Sig=3; // - закрываем в бай
   //-----------------------------------------------------------------------
   //Указываем Сигналы на закрытие SELL:
      if(
         GetExtremumZZPrice() <= Ask
      )
         Sig=4; // - закрываем в селл
      if(Sig==3 &&  EPs(Symbol(),OP_BUY,Magic))
         CPD(Symbol(),OP_BUY,Magic);
      if(Sig==4 &&  EPs(Symbol(),OP_SELL,Magic))
         CPD(Symbol(),OP_SELL,Magic);
   */
//-----------------------------------------------------------------------
//Указываем Сигналы на открытие BUY:
   if(
      Senkou_A < Senkou_B
      &&
      GetExtremumZZPrice() <= Ask
   )
      Sig=1; // - открываемся в бай
//-----------------------------------------------------------------------
//Указываем Сигналы на открытие SELL:
   if(
      Senkou_A > Senkou_B
      &&
      GetExtremumZZPrice() >= Bid
   )
      Sig=2; // открываемся в селл
// 1 - бай  2 - селл, 3 - закрытие бай, 4 - закрытие селл
   return(Sig);
  }
// ========================================================================

ZZ v4.0