[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 283

 
tara:

You could do it in a flowchart. You could do something else, but in a very thorough and unambiguous way. So that I won't be able to kick you for the inconsistency of the idea with its description.

I will not do it.

Did you come into the thread to write that you won't do it? To do what? Just to write.... ?
 
In order to do it myself. Lord, forgive me, a sinner
 

I think... there's either a need to check the price some time ago, if it was correspondingly higher (in the baja phase), something else to consider. Fuck knows. I have no idea how to formalise it.

I am not asking to write it for me. I'm just asking for help to formalise it verbally...

 

It's not a bad thing to do. I'm talking about coding, as they say here. You see, when you create a serious program, you create a world that lives by the rules you set up. It is not a fact that you yourself will be able to understand this world after you have created it.

Therefore, give us the rules :)

 
hoz:
Hasn't anyone implemented this. I don't think it's very complicated. I just don't have much experience yet, I don't quite understand how to formalize this point ...

Hi Victor! To open Bai should be (Ask - ema), check! If I got it right!?
 

Hello, Boris. I did, by the way. I've already posted the code above, I'll duplicate it:

//+-------------------------------------------------------------------------------------+
//| Получение значений МА на указанном баре                                             |
//+-------------------------------------------------------------------------------------+
double GetMA(int index, int maPeriod)
{
   return (iMA(NULL, i_TF, maPeriod, 0, MODE_EMA, MODE_CLOSE, index));
}
//+-------------------------------------------------------------------------------------+
//| Имеет ли место отскок?                                                              |
//+-------------------------------------------------------------------------------------+
void IsRebound(int crossDir[], bool& returnSign[])
{
   for (int i = 0; i < 4; i++)
   {
      if (crossDir[i] == CROSS_NO)
         continue;

      returnSign[i] = false;
      double ema = GetMA(1, g_maPeriod[i]);

      if (crossDir[i] == CROSS_UP)
      {
         if (ND(MathAbs(ema - Ask)) <= i_thresholdFromMa * pt) // ..зазор между ценой покупки и машки, <= i_thresholdFromMa..
         {
            returnSign[i] = true;

     Alert("CROSS_UP");
         }
      }
      if (crossDir[i] == CROSS_DN)
      {
         if (ND(MathAbs(ema - Bid)) <= i_thresholdFromMa * pt) // ..зазор между ценой продажи и машки, <= i_thresholdFromMa..
         {
            returnSign[i] = true;
       Alert("CROSS_DN");
         }
      }
   }
}

But it doesn't work that way for some reason...

 
hoz:

Hello, Boris. I did, by the way. I've already posted the code above, I'll duplicate it:

But it doesn't work that way for some reason...


Try it the other way round: (Ask - Ema) and optimize thisi_thresholdFromMa!
 
borilunad:

Try it the other way round: (Ask - Ema)

What's the difference? :)
 
hoz:

What's the difference? :)

What should be higher? If Ask in the case of Bai, then Yema in the case of Sell. Correspondingly: If yema in the case of Bai, then Bid in the case of Sell! For symmetry, logically. You won't subtract the greater from the lesser!
 
borilunad:

Which should be higher? If Ask in the case of Bai, then Yema in the case of Sell. Correspondingly: If yema in the case of Bai, then Bid in the case of Sell! For symmetry, logically. You won't subtract the greater from the lesser!
So it doesn't matter. I'm returning an absolute value, modulo through MathAbs...
Reason: