Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1136

 
Maxim Kuznetsov:

one sell limit, volume = sum of all three...after the trigger, if you have free time, close the whole batch via CloseBy


i have three buy orders and i want to get a single stoploss for all three

I just want to know how to read the data in this case

I need the format

"if i move the line to 1.09000 i will make a loss of xxx pips ooo money"

in this case, with the move to1.10150 the lowermost stop does not fit perfectly, it will be positive.
 
trader781:


I have three buy orders and I want to get a single stoploss for all three

I just want to know how to read the data in this case

I need the format

"if i move the line to 1.09000 i will get a loss of xxx pips oooh money"

One more time, you want to handle Sl/Tp of a group of orders as one (single line-order): the general stop-loss for a "buy order" is a Sell-Stop (in my previous post - wrong, I hurried up :-) ). And the common Take-Profit is Sell-Limit.
 
Maxim Kuznetsov:
Once again, you want to manage Sl/Tp of a group of orders as one (single line-order)


what does that have to do with pending orders?

yes, that's right

 
trader781:


what do pending orders have to do with it?

Yes, that's right.

Because a SellStop is a Stop Loss and a Limit Stop Loss is a Take Profit, the idea is the same.

If the volume of the SellStop is equal to the total volume of Buy positions opened, the triggered pending order will be nothing else but a common stop for all Buy positions.

If the volume of the "SellStop" is greater than the total volume of positions, its triggering will cause a position reversal - the remaining lot of the difference between the total position lots and the "1" lot will become the volume of the opposite position.

If the volume of the pending order is less than the total volume of positions, the trigger of the pending order will result in a partial closing, and the remaining volume of all positions will be the remainder of the position after the partial closing.

 
Artyom Trishkin:

This is because a SellStop is a Stop Loss and a Limit Stop Loss is a Take Profit - essentially the same thing.

If the volume of the SellStop is equal to the total volume of open Buy positions, then the triggered pending order will be nothing else but a common stop for all Buy positions.

If the volume of the "SellStop" is greater than the total volume of positions, its triggering will cause a position reversal - the remaining lot of the difference between the total position lots and the "1" lot will become the volume of the opposite position.

If the volume of the position is less than the total volume of positions, then the trigger will cause a partial closing of the position, and the remaining volume of all positions will be the remainder of the position after the partial closing.


I got it, but it seems to me that this is not the right approach in this case

there is a "close all if price is above/below the line" trigger

It goes without saying that it will only be visible in my terminal and the calculation is virtual for the manual assistant. That is why I am asking what should be done to calculate such parameters when OrderType()<2

 
trader781:


I got it, but it seems to me that this is not the right approach

there is a "close all if price is above/below the line" trigger

of course it will only be visible on my terminal and the calculation is virtual for use in the manual assistant. It will be a common object with stop calculation. That is why I am asking what I should do to calculate such parameters when OrderType()<2.

The parameter OrderType()<2 searches only for positions; if we explain in details, Buy is OrderType()=0 and Sell is OrderType()=1.

To calculate a breakeven on orders, you should use OrderType()>1.

The forum is full of formulas, you should just start looking for them

 
Vitaly Muzichenko:

The "OrderType()<2" parameter searches only for positions; if we explain in details, Buy is OrderType()=0 and Sell is OrderType()=1.

To calculate a breakeven on orders, you should use OrderType()>1.

The forum is full of formulas, you just have to search for it.


I do not understand why they need a breakeven? (partially with your help, by the way).

Well, they do exist, so what next? You just have to start looking for it. What's its practical use? You should get a number different from zero in the "pips" and "money" formats and that's it. I do not have to look for it, but I'm sure you will find it in the right places.

 
trader781:


I don't get it. Why do you need Breakeven?

So what then? It should be a number other than zero in the format "points", "money" and that's it. You may be able to enter the market with a certain level of confidence.

You may subtract/add pips from breakeven, translate them into money and you will get the result you need.

 
trader781:


I get it, but in this case it seems to me to be the wrong approach

there is a "close all if price is above/below the line" trigger

It goes without saying that it will only be visible on my terminal and the calculation is virtual to be used in the manual assistant. That is why I ask what I have to do to calculate these parameters when OrderType()<2

you have to calculate average price of position.

Position_price_buy=(Buy1_price*Buy1_lots+Buy2_price*Buy2_loys+...)/(Buy1_lots+Buy2_lots+...) - loss_on_swap; // that is, sum of position weights/total volume

 
Maxim Kuznetsov:

you have to calculate the average price of the position.

Position_price_buy=(Buy1_price*Buy1_lots+Buy2_price*Buy2_loys+...)/(Buy1_lots+Buy2_lots+...) - loss_on_swap; // that is, sum of position weights/total volume


so we will have this format:

points= offset from the average price line

loss=average price loss

right?

Reason: