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

 
Chiripaha:

I link the text to the line price + 3*Point (i.e. I put it slightly higher), but still, when I change the size of the chart (window), the text is above the line, then below, then at the line level (it jumps)... Why does this happen? - I'm kind of giving the exact price coordinate. How is it solved?

I've looked and tried how others do it, but the effect is similar. I want to understand how this "bounce" gets rid of. And most importantly, why it appears, since the coordinates are hard: price and time.

The text is entered in the object description and the chart is allowed to show object descriptions (one of the ways).
 
Usual_Trader:


you formalise the wish a bit. Exactly when closing a specific order?

If not, then very simply:

at the beginning of the program

int previous_total_orders=0;

on the program body:

at the opening of a new order

previous_orders++;

check:

if (prevous_orders>OrdersTotal()) CloseAllTrades(Sym); //this function can be any of the code that closes all orders for a given symbol

If it is the last open order that is closed, then

at the beginning of the program, declare Last_ticket variable

when the order Last_ticket=OrderSend..... is opened

check:

if(OrderSelect(OrderSelect(Last_ticket,SELECT_BY_TICKET, int pool=MODE_TRADES)!=true)CloseAllTrades(Sym);

I tried it but it doesn't work when entering if(OrderSelect(OrderSelect(Last_ticket,SELECT_BY_TICKET, int pool=MODE_TRADES)!=true)CloseAllTrades(Sym);

an error appears:

')' - unbalanced right parenthesis , '!=' - initialization expected , 'true' - comma or semicolon expected , 'Sym' - variable not defined , 'pool' - variable already defined .

'Sym' - variable not defined - I removed this value by replacing it with lasttype==OP_SELL , the rest I don't know




 
Frostr:

I tried it, but it does not work when entering if(OrderSelect(OrderSelect(Last_ticket,SELECT_BY_TICKET, int pool=MODE_TRADES)!=true)CloseAllTrades(Sym);

an error appears:

')' - unbalanced right parenthesis , '!=' - initialization expected , 'true' - comma or semicolon expected , 'Sym' - variable not defined , 'pool' - variable already defined .

Sym' - variable not defined - I removed this value and replaced it with lasttype==OP_SELL , the rest I don't know.




Haven't you noticed that I did not write this as ready-made code, but as an idea? ))

sorry, I typedOrderSelect twice

if(OrderSelect(Last_ticket,SELECT_BY_TICKET, int pool=MODE_TRADES)!=true)CloseAllTrades(Sym);

TheCloseAllTrades(Sym) functionis purely my function, look in Kim V.'s function, there is probably a similar function that closes all trades for this pair. You have to declare the variable Sym as string Sym=EURUSD; (this is as a possible variant of the pair)

 
Chiripaha:

I link the text to the line price + 3*Point (i.e. I put it slightly higher), but still, when I change the size of the chart (window) the text is now above the line, now below, now at the line level (it jumps)... Why does this happen? - I'm kind of giving the exact price coordinate. How is it solved?

I've looked and tried how others do it, but the effect is similar there. I want to understand how this "bounce" gets rid of. And most importantly, why does it appear since the coordinates are hard: price and time?


This occurs because different timeframes have different chart scales and3*Pointshave different dimensions in pixels. To make the distance is always the same, you need to selectthe desired distance in pixels andcalculate how many points it will be foreach timeframe using functionsObjectGet() and ObjectSet(). with identifier OBJPROP_XDISTANCE, and set the text binding angle lower to always have the text above the line, and upper to below.
 

Where can I download normal quotes?

The Quotes Archive is downloading in chunks for some reason.

 
Good afternoon. Can you explain how to organise "multi-modularity"? I want the big functions to be in separate files.
 
Nekseron:
Good afternoon. Can you explain how to organize "multi-modularity"? I want the big functions to lie in separate files.


  • A library
    is a library of user functions designed to store and distribute frequently used blocks of user programs. Libraries cannot be run on their own.
    It is recommended to store libraries interminal_directory\experts\libraries.

  • Includedfile is the source text of commonly used blocks of user programs. Such files can be included into Expert Advisors, scripts, custom indicators and libraries at compiling stage. The use of include files is more preferable than the use of libraries because of additional overhead costs when calling library functions. It is recommended to store include files in terminal_directory\experts\include

 
Nekseron:
Good afternoon. Can you explain how to organise "multi-modularity"? I want the big functions to lie in separate files.
As an example, you can see how this EA, or this one, for example, is organised.
 

Hello, Can someone please advise which site where you can borrow a small amount of WMZ with a formal certificate, I need an urgent 3 WMZ and go to put, now I can not (((

 
rigonich:

This is because different timeframes have different chart scales, sothe 3*Pointshave different pixel sizes. To make the distance was always the same, you need to selectthe desired distance in pixels andcount the number of points foreach timeframe using functionsObjectGet() and ObjectSet(). with identifier OBJPROP_XDISTANCE, and set the angle of text binding lower to the text was always above the line, and upper to below.
Thanks a lot, Vitaly! I will make some experiments. I think that variant with an angle of snaps should help. I just don't know how to do it yet, but it's clearer now what to experiment with. Thanks again!