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

 
Vinin:

Why at the same time? You can do it sequentially. First the first, then the second, then the third and so on.

Well, you can do it that way, but only as a code))) Thank you.
 
OrderSend(.......................);
OrderSend(.......................);
OrderSend(.......................);
OrderSend(.......................);
OrderSend(.......................);
OrderSend(.......................);

 
Maniac:


How about this ...?

We need:
1) the EA should simultaneously place three pending orders with stops of 25 and takeovers of 15, 35, 50
2) After the second order is closed at take (35), the last position (with take 50) should be moved to the breakeven position
Thank you.

Mistake:

SetOrder(NULL,OP_BUYSTOP,0.1,High[1]+10*Point,Ask+30*Point,Ask-15*Point);
SetOrder(NULL,OP_BUYSTOP,0.1,High[1]+10*Point,Ask+30*Point,Ask-35*Point);
SetOrder(NULL,OP_BUYSTOP,0.1,High[1]+10*Point,Ask+30*Point,Ask-50*Point);

Places the first 3 (TP 15) orders


You have to look at the function
 
Vinin:

I'll have to look at the function.

Thank you. I figured it out myself. I messed with the signs.
 
And if the first two closed at take (15, 35), how can the third (50) be taken to breakeven?
 
Maniac:
And if the first two closed at take (15, 35), how can the third (50) be taken to breakeven?
Look for the tickers of the first two orders, check their closing time. If the time is more than zero, it means that the orders have already closed.
Next, look profit of these orders and if it is more than zero, it means that we closed in profit. (I don't know if you have a trawl).
So we have... We have two necessary orders closed in profit. Now we take the third order and if it is still in the market (to check and choose at the same time),
Then we modify its stop by moving it to the desired break-even point...

Oh boy! :)

Assuming the next question, I would say at once - when you set an order, you should also remember its ticks in your needed variables.
Then, when you search for order, from variables you will get the ticket you need...
 
artmedia70:
Look for the tickets of the first two warrants, see their closing times. If time is more than zero, it means that the orders have already closed.
Next, look profit of these orders and if it is more than zero, it means that we closed in profit. (I don't know if you have a trawl).
So we have... We have two necessary orders closed in profit. Now we take the third order and if it is still in the market (to check and choose at the same time),
Then we modify its stop by moving it to the desired break-even point...

Oh boy! :)

Assuming the next question, I would say at once - when you set an order, you should also remember its ticks in your needed variables.
Then, when you search for order, from variables you will get the ticket you need...

Thank you. I will keep trying. If I can't do it myself, I'll come back to this thread and ask to code all this text.
 
People, tell me how to do the following:

There is an indicator (e.g. CCI). I need to know its maximal value on the given period.
The figure shows the end of the period with a red vertical line and the maximum with a blue ellipse.

I'm trying to do it with iHighest, but I can't figure out how.


 
Forrim:
People, tell me how to do the following:

There is an indicator (e.g. CCI). I need to know its maximal value on the given period.
The figure shows the end of the period with a red vertical line and the maximum with a blue ellipse.

I'm trying to do it with iHighest, but I can't figure out how.

Maybe we should loop through the necessary period and find the maximal value?
 
artmedia70:
Maybe I should loop through the required period and find the maximal value?

Something like this is also on my mind

for (i = period;i>=0;i--){

... temp1= iCCI(..., i)

temp2= iCCI(..., i+1)

if temp1 > temp2...

But I still can't figure out how to get one, the largest value.

Reason: