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

 
Pyro:

Can you please tell me how to check the validity of an order? For example, I have a pending order in place and need to check if it has triggered a stop order.


bool check=OrderChek(ticket);

Comment("The order with the ticket ", ticket, "does not exist (triggered)");


I can't find how to do this.

OrderCloseTime
 
Sergey_Rogozin:
The function looks like this

That is, if there are open positions, the function will detect them and return true.

Your task is to put something like this before OrderSend(.......):


Yeah thanks))
 
 
in identifying a trend?
 

Can you tell me why, when I insert a line in the EA

Comment (High[Bars-1]);
and run the Expert Advisor in the Visual tester - it prints the same value despite the fact that bars are changing ?
 

paibolit ,Bars is the number of history bars, it is set in the settings.

Vovo4ka ,read the Tutorial

 
eddy:

paibolit ,Bars is the number of history bars, it is set in the settings.

Vovo4ka ,read the Tutorial


Yes knowledge is power))
 
paibolit:

Can you tell me why when I insert a line in the EA

and I run the Expert Advisor on the Visual tester - it prints the same value despite the fact that the bars are changing ?

Put a specific bar number, for example, High[ 3 ] and you will get changes.

You have taken the very first bar in the history and it, in turn, remaining always the first one, gives you the same value.

 
Sergey_Rogozin:

Put a specific bar number, for example High[ 3 ], and you will get a change.

You have taken the very first bar in the history and it, in turn, remaining always first, gives you the same value.


This is my first experiment with bars - thanks for the normal explanation
 

I have two simple topical questions, who knows, please answer me!

eddy 25.02.2011 03:27


do not understand why

HighesBuffer[i]=MathMax(HighesBuffer[i],High[k]); //if(High[k]>maximum) maximum=High[k];
 LowesBuffer[i]=MathMin(LowesBuffer[i],Low[k]);   // if(Low[k]<minimum) minimum=Low[k];

it's not the same as

if(High[k]>HighesBuffer[i]) HighesBuffer[i]=High[k];
if(Low[k]<LowesBuffer[i]) LowesBuffer[i]=Low[k];
eddy 26.02.2011 03:23

you can create functions with optional parameters. can i make a function that returns the sum of values passed to it, so that their number is unlimited? or at least limited, but large)