[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 136

 
I'm not the first time I've tried to set it manually, but MT was swearing and insisting that the minimum stoploss and profit should be 300. is this a glitch???
 

Unfortunately, this is not a glitch.

Some DCs have a habit (with or without reason) of changing the minimum stop levels several times during the day.

What is it for? Officially it is argued with ridiculous (and often false) reasons, "at the request of working traders", reference to the counter-agents / vendors, stock-exchange traditions on strong movements and other nonsense.

In fact, in many cases it minimizes your profit (or increases your loss), i.e. it increases the profit of the brokerage company.

You are lucky that you have not had a similar option - "FREEZE LEVEL" (especially greedy brokerage companies have it)!

I usually provide in the code of the Expert Advisor (for example):

 double PriceBuy      =  ObjectGet("EntryL0", OBJPROP_PRICE1);      // Цена покупки
   double ProfitBuy     =  ObjectGet("TargetL0", OBJPROP_PRICE1);     // Цена прибыли
   double LossBuy       =  ObjectGet("LL30", OBJPROP_PRICE1);         // Цена убытка
   if (( PriceBuy-Ask) < MODE_STOPLEVEL*Point) PriceBuy  = (Ask+MODE_STOPLEVEL*Point);//расст. от цены
   if (( ProfitBuy - PriceBuy) < MODE_STOPLEVEL*Point) ProfitBuy = ( PriceBuy +MODE_STOPLEVEL*Point);//тейк 
   if (( PriceBuy- LossBuy) < MODE_STOPLEVEL*Point) LossBuy = ( PriceBuy - MODE_STOPLEVEL*Point);//лосс
//------- задаем значения линий для продажи --------------   
   double PriceSell     =  ObjectGet("EntryH0", OBJPROP_PRICE1);      // Цена продажи
   double ProfitSell    =  ObjectGet("TargetH0", OBJPROP_PRICE1);     // Цена прибыли
   double LossSell      =  ObjectGet("HH30", OBJPROP_PRICE1);         // Цена убытка
   if ((Bid - PriceSell) < MODE_STOPLEVEL*Point) PriceSell= (Bid - MODE_STOPLEVEL);  
   if (( PriceSell- ProfitSell) < MODE_STOPLEVEL*Point) ProfitSell= ( PriceSell -MODE_STOPLEVEL*Point);//тейк  
   if (( LossSell- PriceSell) < MODE_STOPLEVEL*Point) LossSell = ( PriceSell + MODE_STOPLEVEL*Point);//лосс
 
sergeev >> :
if (MathMod(Minute()+1, 5) ==0)
  {
      bWas=false;
      if (Seconds()>=50 && ! bWas)
      {
        // делаем то что вам надо 
          bWas=true; // только один раз
          RefreshRates(); // обновляем данные валюты
        //........
      }
  }

But

int Minute( )
Returns the current minute (0,1,2,...59) of the last known server time at program start (this value does not change during program execution).

и

int Seconds( )
Returns the number of seconds elapsed since the start of the current minute of the last known server time at program start (this value does not change during program execution).

 
SK. писал(а) >>

The frequency of "talking" should be small, otherwise the broker will consider this phenomenon undesirable and may ban the use of EAs.

Can a broker forbid the use of EAs to a particular user? Or impose restrictions on the trading account?

If it is written in the trading conditions that trading with Expert Advisors is permitted?

 
JavaDev >> :

And how can the GMT offset affect the M5 time series relative to D1?

Please enlighten Dear DrShumiloff.

The question of a beginner with 20 years of programming experience.

I can only enlighten you, because teaching is light. A enlightenment, that is to become holy - the Church.

Concerning your question.


The person asks: "How do you find the bar at let's say the five minutes of the beginning of the day."

You, when you take the start of the day:

iTime(Symbol(), PERIOD_D1, 0)

don't take into account that the opening time of the day's candle in broker quotes is quite arbitrary.

I, for example, have a 4 hour offset from GMT on Alpari. So when calculating pivot levels, for example, I have to recalculate all open-close prices considering this offset.

The correct thing to do would be to take the current hour, add an offset to it and find out the opening time of the calculated bar number on the clocks.

 

I repeat my question - WHAT does GMT have to do with it ?

Show the CODE - how to do it properly (according to you), not empty remarks.

 

Hello All!!!

how to convert an ex.4 file to an mq4 file?

 
decompel, decompel.
 
BARS писал(а) >>
>> decompile, decompiler.

What kind of beast is that? >> And where do I get it?

 
VeDMeD >> :

But

int Minute()
Returns the current minute (0,1,2,...59) of the last known server time at program start (this value does not change during program execution).

и

int Seconds()
Returns the number of seconds elapsed since the current minute of the last known server time at program start (this value does not change during program execution).


check your code first (print or somment) - and then look in your help! :)