[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 438

 
kosolapov:
Can you tell me how to compare the current price of the current bar with the maximum price of the previous bar?

Bid - current price of the current bar,

High[1] - maximum price of the previous bar

 

Friends, how can this be? An incomprehensible phenomenon of nature is captured in the screenshot.


 
artmedia70:

Maybe you know why on visualisation the code returns angle_line variable (returns angle normally), but on testing and running it does not (returns 0th angle). Thanks!

//+------------------------------------------------------------------+
int start()
{
//----

ObjectCreate("LineAngle", OBJ_TRENDBYANGLE, 0, 0,0);
ObjectSet("LineAngle", OBJPROP_TIME1, Time[2];
ObjectSet("LineAngle", OBJPROP_PRICE1, Close[2];
ObjectSet("LineAngle", OBJPROP_TIME2, Time[0];
ObjectSet("LineAngle", OBJPROP_PRICE2, Open[0]);

double angle_line=ObjectGet("LineAngle",OBJPROP_ANGLE);

Print(" angle_line ",angle_line);

return(0);
}
//+------------------------------------------------------------------+

 
kosolapov:
Can you tell me how to compare the current price of the current bar with the maximum price of the previous bar?
if (Close[0] < High[1]) {

   ...

}
 
Is there any way to track all EA actions, i.e. creating variables, assigning values to them, comparing conditions, etc.?
 
001:

Maybe you know why on visualisation the code returns angle_line variable (returns angle normally), but on test and run it does not (returns 0th angle). Thanks!

//+------------------------------------------------------------------+
int start()
{
//----

ObjectCreate("LineAngle", OBJ_TRENDBYANGLE, 0, 0,0);
ObjectSet("LineAngle", OBJPROP_TIME1, Time[2];
ObjectSet("LineAngle", OBJPROP_PRICE1, Close[2];
ObjectSet("LineAngle", OBJPROP_TIME2, Time[0];
ObjectSet("LineAngle", OBJPROP_PRICE2, Open[0]);

double angle_line=ObjectGet("LineAngle",OBJPROP_ANGLE);

Print(" angle_line ",angle_line);

return(0);
}
//+------------------------------------------------------------------+


No objects are built during testing and optimisation
 
Vinin:

Objects are not built during testing and optimisation

How do I find out the angle of a straight line in an EA in such cases?
 
001:

How do you find out the angle of a straight line in such cases, in the EA?

Count. Everyone has studied arithmetic
 
Good evening! Error 4051 is being written after a long normal run, and suddenly, at about 200 times, the pending order is not placed. Error 4051 is
Invalid value of a function parameter

It also writes disabled lot something. I calculate lot volume*A, where extern double volume=0.1; A=NormalizeDouble(A,0);

Here, for order, is the whole order

 tiket= OrderSend( Symbol(), OP_BUYSTOP,  volume*A, Price +otstup*Point,Point * 3, R1, Price+takeprofit*Point+otstup*Point, "OP_BUYSTOP", 1000,  expiration, Red); 
   Alert ("OP_BUYSTOP", GetLastError( ));  }M=0;
   if (GetLastError( )!=0){Alert ("tiket",tiket," volume*A ",volume*A," Price +otstup*Point ",Price +otstup*Point," Price+takeprofit*Point+otstup*Point ",Price+takeprofit*Point+otstup*Point);}

And A takes values somewhere between one and sixteen...

 
I'm at a loss!!! What's he missing? Yeah, and the last alert doesn't work... And so is this.
if (GetLastError( )!=ERR_NO_ERROR){Alert ("t
Reason: