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

 
n-i-k:

Searching, searching, I can't find anything... How to get cursor coordinates in the script: X(datetime), Y(price)?

https://www.mql5.com/ru/forum/108262
 
double StartX=Time[5]; double EndX=Time[15];

ObjectCreate("x",OBJ_TREND,0,StartX,StartY,EndX,EndY);
...
по оси Y все хорошо. как сдвинуть по оси X его вправо.. к самому краю окна?
 

Good evening!

There is a standard function:

int DayOfWeek( )
"Returns the sequence number of the day of the week (Sunday-0,1,2,3,4,5,6) of the last known server time.
Note: when tested, the last known server time is simulated. "

Can you tell me, what does it mean when testing the last known server time is simulated?

Perhaps the question is simple, I can imagine, but I am not sure, I would like to know exactly.

Please tell me.

 
This means that this parameter will change during the test, rather than being read from the server for today. I.e. if you set a Friday trading ban, Fridays will be skipped during the test.
 
Roger:
This means that this parameter will change during the test, rather than being read from the server for today. I.e. if you set a Friday trading ban, Fridays will be skipped during the test.


Understood, thank you

 

How do I get the cursor coordinates in the script: X(datetime), Y(price)???

Roger

, thank you!

I started digging in the same direction myself, but realised that a simple thing would turn out to be quite cumbersome - first we need to get the cursor coordinates in pixels, then they need to be converted to coordinates in chart units X(datetime), Y(price). And if price on the chart is linear, time is far from always - there are both missed bars and missed days (weekends), i.e. the task is clearly no longer trivial.

While the required coordinate X(datetime) is "seen by eye" in the bottom info-panel, there is only one way to get it, but how??? If the cursor as an object had the same description as e.g. other graphical objects...!

 
 

Please answer a question - magic in an order, is it saved, even when the order is closed?

I will explain, for example, every day opens a trade

OrderSend (Symbol(), OP_BUY, Loot,Ask, 50, SL, TP,NULL,100,0,L);

and every day the trade is closed.

OrderClose(OrderTicket(),Loot,Ask,50,Rc);

And if we test it by history - what will happen to Magic?

 

Is there any way to reset the Magic to zero every day, because they are opened in different order and it would be convenient for me to control them with the magic-command, can you do that?

 
Boneshapper:

Please answer a question - magic in the order, is it saved even when the order is closed?

And if you test it by history, what will happen to Magic? I have no luck with history, so it is probably still saved?

Yes, it will be saved. Magic cannot be reset. It's hard to know what you want exactly.