[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 68

 
sergeev:

right it pops up.

You have to take Bid and Ask from MarketInfo function

like - ask= MarketInfo(OrderSymbol(), MODE_ASK);

and do not forget to normalize
ask=NormalizeDouble(ask, MarketInfo(OrderSymbol(), MODE_DIGITS));

 

Please tell me, you are doing the normalisation process,

What does it do? Explain if you don't mind.

 
iv_danko:

Tell me please, here you are doing the normalisation process,

And what is it done for? explain if you don't mind.


double NormalizeDouble( double value, int digits)

Rounding a floating point number to the specified precision.
The calculated StopLoss and TakeProfit values, as well as opening prices of pending orders should be normalized to the accuracy, the value of which is stored in the predefined variable Digits.

An error may occur when prices are not normalized.

 
Vinin:

Sorry. Totally forgot.

Thanks for the indicator, but it's not the same. The condition (ma13_0-ma55_0)*(ma13_1-ma55_1)<0 shows whether or not there was a crossover between the flaps (I made a separate indicator for it). You have inputs by crossing, and it is not quite the same. I want to filter the arrows so that only the first arrow after changing the direction is shown.

The arrows in your indicator are big. The small ones are of an indicator that needs to be tweaked.

 
gince:


I'll add. It's not exactly buying and selling. It is also a price calculation of stop orders.

 
iv_danko:

Please tell me, you are doing the normalisation process,

What does it do? Explain if you don't mind.

 

Why doesn't this check work?

for(int i=limit-1;i>=0;i--){ 
   flag[i] == flag[i+1];   
   if ( flag[i] == 1  &&   
        условие продажи){              
       Продажа[i] = High[i]+point*Point; 
       flag[i] == -1 ;
    }                     
    if (flag[i] == - 1  &&     условие покупки){          
              Покупка[i] = Low[i]-point*Point; 
              flag[i] == 1 ;}
    }
}    
 
I would do a temporary rendering of flag[] buffer and see what's in it. At a glance all values in it will be the same.
 
gince:

Why doesn't this check work?

I think they did the right thing.
 
granit77:
I would do a temporary rendering of flag[] buffer and see what's in it. At a glance, all values in it would be the same.
Did a temporary render of buffer flag[] - it's empty, why? Where is my mistake?
Files:
cross1_2.mq4  5 kb
Reason: