[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 331

 

Sepulca

then at a glance you can try this as in the attached file. The changes are accompanied by the comment "// Modify for Elektronik".


Unfortunately, I can't check your modification, there is an error

I can't open a SELL EURUSD 2 at 1.2445 , Error 4109.

And the script is this.

Files:
reverse.mq4  16 kb
 

Good afternoon.

Could you please tell me why the result is distorted when converting double to int

int init()

{

int sum=(1.3167+0.001)*10000;

Alert (sum);

return(0);

}

The result is printed as 13176.

It should logically be 13177.

This issue appears only when adding. When subtracting

int sum=(1.3167-0.001)*10000;

it produces the correct result: 13157

I wonder if opening the brackets

int sum=1.3167*10000+0.001*10000; 

then it gets it right. What's the difference?

Thanks in advance.

 
GygaByte:

Good afternoon.

Can you please tell me why when converting double to int the result is distorted

Write down:

int sum=NormalizeDouble((1.3167+0.001)*10000,Digits);
and it will read correctly.
 

Thanks for the tip from Sepulca , got it sorted.

      if (OrderComment()==""){
         MyComment="";
      } else {
         MyComment="[" + OrderComment() + "]";
      }
 

Thanks for the tip from Sepulca , got it sorted.

      if (OrderComment()==""){
         MyComment="";
      } else {
         MyComment="[" + OrderComment() + "]";
      }
 
hoz:


Well, I have in my code a fixation of when the indicator value is greater than the indicator level and less than(indicator level + allowable deviation, a kind of gap). Here:

0.1 I took at a guess. But the openings occur at the wrong moment.

Judging by your words, you need to compare the value on some bar, which is lower than the indicator level with the value on the zero bar above (level + clearance) and not vice versa?

But if we find the crossing of the indicator value on the previous bar and the value on the current bar (through the specified level), then for the current bar the value, and consequently, the price can fly very far and, consequently, this is not an option at all. How then to clearly spell out the condition I wrote about? Here is a screenshot explaining the situation:

From the screenshot, you need to check: if the RSI on the first bar is less than the level and the RSI on the zero bar is greater than or equal to the level, then buy. At the same time RSI should be counted at opening prices - otherwise you cannot avoid false positives on the zero bar. If you want to read RSI at other prices (closing prices, for example), then check the second and first bar accordingly.
 
hoz:


Boris, you have the value drawn from the 1M timeframe. And it is compared not to the level but to zero. I do not understand why the value will be taken at each tick. Maybe it's not complicated, but I haven't worked with indicators before and it doesn't seem to be logical.

Again, if the values are taken at each tick, how do you compare to a specific level so that at each tick the examiner follows that level?

In my case, to buy on M5 I wrote the following way:

Herei_RSIToUpLimit is the level of the RSI indicator. I understand that the period for M1 must be multiplied by 5 to use the level on M5, right? Then the period will be 70 and not 14.

Victor, instead of zero, put your level in one direction with a plus and in the other with a minus! And as with Close on the zero bar, on which tick your level will pass, so will give a signal! The period of RSI will determine the optimization! In general, Artem is right! Do as he advises!
 
abolk:

Write it down:

And everything will count correctly.


Correct, but as practice has shown - not always...

int init()
  {
//----
double bid=NormalizeDouble(Bid,Digits);
double b=NormalizeDouble(0.0005,Digits);
double bid_minus=NormalizeDouble(bid-b,Digits);
double bid_plus=NormalizeDouble(bid+b,Digits);

Alert ("bid= ",bid," bid_minus= ",bid_minus," bid_plus= ",bid_plus, " Bid = ",DoubleToStr(Bid,6));
//----
   return(0);
  }

If the fifth decimal point = 5 (1.xxxx5), the value is still distorted:

Alerts

the question is still valid...

P.S. Generally, I need to assign a price value to MagicNumber... And type MagicNumber - int, here and try to convert by

int MN=NormalizeDouble(Bid*10000,Digits);

Who else can give me advice?

Thank you.

 

Greetings all! Happy Victory Day!

Can you please tell me why the terminal does not connect, gives the message "No connection", although there is a ping. Although there is a ping, in fact there is a connection with the server. Here is a screenshot: http://snag.gy/UFNFL.jpg

Ping test

The data for registration is not created http://snag.gy/i8cmn.jpg

Does not register

This "Please wait" takes more than an hour. Usually it should be instantly.

I do not understand what I am doing wrong. Why no connection, if i have one, why i got ping?

M5 I tried everything and got registered, but M4 I cannot, I have tried it 20 times.

Please advise, who knows!

 
Good evening. Could you please tell me if there are any market profile indicators? And also a documentation or description of how to use them? At least the simplest signals to enter the market using market profile indicators?