[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 592

 
Roger:


Start at the end, then the first matching one is the one.

for (int i=OrdersHistoryTotal()-1;i>=0; i--)//
if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)==true)


it doesn't change the picture, how can we keep the last closed order?
 
vik-777:
it doesn't change the picture of how to leave exactly the last one closed on magic?

The last closed can only be determined by the closing time. This order will have the longest closing time. If the order magic corresponds to the one we need, then this is the order we need.
 
drknn:

The last closed order can only be determined by the closing time. This order will have the longest closing time. If the magic number of the order corresponds to the one we need, then this is the order we need.
So how can I compare which order has the longest closing time?
 

CMM indicator i-AnyRange. I want to write its width in pips above each channel.

I wrote it this way

double Ch=MathAbs((up-dn)/Point);

double n_ch=NormalizeDouble(Ch,1);

string cha=DoubleToStr(n_ch,0);

double x=after theClose of thelast drawn candle in the channel. How to do this

double y=NormalizeDouble(Ch/2+up,4); above the channel by half of its height

ObjectCreate("Ch",OBJ_LABEL,0,x,y);

ObjectSetText("Ch",cha,20, "Tahoma",Gold);

Files:
 

Good afternoon.

Can you please advise me, I have applied MA indicator to DeMarker using First Indicators data method. Is it correct to use iMAonArray function for this in writing the EA?

 
Good day! Please help me write an EA which would open a new order at once after tp or sl has been passed.

If BUY TP, then BUY is on;

If BUY on SL, then SELL is on;

If SELL on TP, then SELL is on;

If SELL on SL, then BAY is on;

I just started to learn MQL, I've been thinking for days. I can't understand it without help! I would be glad to help!

if you have any ideas, drop me a line!
 
Top2n:
Good day! Please help me write an EA to open a new order immediately after the tp or sl is passed at one moment.


Oh man, another spammer!
 
PapaYozh:
Shit, another spammer!
Why a spammer?
 
vik-777:


Help me solve this problem

I am selecting by all closed positions

for (int i=0; i<OrdersHistoryTotal(); i++)
if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)==true)

afterwards filter by magic number

if (OrderMagicNumber()==12)

the filter satisfies 3 positions, and I only need the last closed position

I can not figure out how to leave only the last one?

Thank you

 

When testing and optimising, we most often use one currency pair, get an acceptable profit, and a drawdown. Then we repeat it for other currencies. But in the end an Expert Advisor will have to trade all currencies we are interested in from one trading account. They say that the expected "total" drawdown can be better than the drawdown obtained for each currency individually (I've seen this opinion several times somewhere). But it can be much worse if several Expert Advisors enter a losing streak at the same time.

So what should we better pay attention to during optimization? What is the maximum drawdown during optimization is considered "normal" (%)?

- I would like toknow the opinion of those who have studied this question or who have practical experience in this field.

- Are there any literature or articles on this subject?

Thank you!

Reason: