Calculate order open to current stop for all trades running
-
I'd like to be able to calculate the distance between order open to current stop for all trades running. This would be a constantly changing figure, and would I suppose be within a trade loop, but I can't figure out how to do it in fxDreema, and my programming isn't up to doing it manually!

Anyone have any ideas?
-
If "order open" means "open price", what is "current stop"?

-
I asked the query on the http://forum.mql4.com/54522 MT4 forum also. Now I have a custom mql4 block containing:
int total=OrdersTotal(); double v1=0; SumAllTradesToStopDistances=v1; for(int pos=0;pos<total;pos++) { if(OrderSelect(pos,SELECT_BY_POS)==false) continue; v1=v1+MathAbs(OrderOpenPrice()-OrderStopLoss()); SumAllTradesToStopDistances=v1; } Comment("SumAllTradesToStopDistances is: ",SumAllTradesToStopDistances;And SumAllTradesToStopDistances set up as a variable to use elsewhere.
This seems to do the trick.
Thank you very much, also.
-
I'm experiencing strange behaviour with this block and code now in the new local version.
I can create this block OK, and input the script, and save it. Then later when I re-edit I get an error message at the top of the screen in a pink surround saying, "Error: Wrong data".
Any thoughts?

......
Clipboard02.jpg -
I missed to look about that problem in the local version, but I will check it later... now I'm trying to understand some mystery that causes the whole website to extremely slow down

-
......AHHHH then it is not my connection!!
-
There is some problem with MySQL on the server, it seems that it works slow as hell sometimes and it tooks tens of seconds to do something very simple, especially within the forum. The technicians said that they have started to repair it, and I hope that it will be ok soon. I really sorry for the troubles.