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

 
if you work the other way round, there will be a lot of stops and, I think, as a consequence, shallow profits
 

I have a simple question for coders

if (condition && condition2) - body of this operator is not executed if both conditions are not met.

how do I make the body be executed until both conditions are false?)

i see a way to create a check - if (!condition && !condition2) bool lozh=true - and execute the body until lozh is not true. is there an easier way?

 
eddy:
If you work the other way round, there will be a lot of stops and, I think, as a consequence, shallow profits

You're right, there will be a lot of stops, especially if you consider a trend, but when the trend starts? Imagine that working with ilan almost every week you will hold 4-6 simultaneous open positions against the trend (with a nightmarish drawdown). The ideology of forex is simple: minimize losses and maximize profits, and ilan is the very opposite that I know.
 

there will be a lot of stops and very few trends:)

look for a link to a description of how it works, so it's easy to read the code, and I'll try to do the opposite

 

Sorry, if you're not too lazy, look, the arrow is not drawing, and I can't make any inference from the error number.

//+------------------------------------------------------------------+
//| balloon.mq4 |
//| Copyright © 2011, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"
double I;
extern double step = 0.02, maximum = 0.2;
extern int shift =0;
string filename ; int handle;

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----


//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{ for (int i=300;i>=0;i--){shift=i;
I=iSAR( 0, 0, step, maximum, shift) ;Alert("i",i);
//----
Alert("I",I);Alert("Open[i]",Open[i]);

string name,N; N=Time[i]; name=name+N;double I;
ObjectCreate("name,OBJ_ARROW, 0,Time[i], I ) ;Alert("GetLastError()",GetLastError()); }



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

 
eddy:

there will be a lot of stops and very few trends:)

look for a link to a description of how it works, so it's easy to read the code, and I'll try to do the opposite

Ok, here it is! Description + EA and its indicators -)
Files:
193.zip  241 kb
 

iSAR( 0, 0, step, maximum, shift) - by the way, did I understand that instead of the last parameter it can be a bar number and the function will give the ball price coordinates for the bar time?

 
Yeah dima
 
THANK YOU!!! If so, me.
 
The terminal closed the losing order with the comment "so:19.5%/28.4/145.8". What does this mean?
Reason: