[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 233
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello Dear MT4 Gurus.
Can you please tell me how to get around the situation when OrderSend returns -1, but the order opens?
Can you tell me how to get around the situation where OrderSend returns -1, but the order opens?
For a position open at 1500, a take at 1570 would be fine (if you don't consider StopLoss), but for a position open at 1600, a take at 1570 would cause error 130 - wrong stops. After all, a Take cannot be lower than the opening price for a Buy. This is already a StopLoss.
For two positions you have defined your breakeven point, but for three-four-five?
You should first define the breakeven formula for unidirectional positions, and then you can create a logic.
I agree that we should make a StopTLoss on an order with a price of 1600
at the opening of the order the function starts:
all other orders will have the same openingWhen we set or change TakeProfit, it all depends on when we set or change it. It is calculated from the current price.
count between orders: ((Ask - OrderBuy2) - swop - ...) + ((Ask - OrderBuy1) - swop - ...) = Profit, we get the number of points that we can lose as they are on the plus side
((Ask - OrderBuy3) -/+ swop -/+ ...) + ((Ask - OrderBuy2) - swop - ...) + ((Ask - OrderBuy1) - swop - ...) = Profit
Ask = 1620; Ask = 1760; OrderBuy3 = 1700
((1620 - 1500) - 4 - 6) + ((1620 - 1600) - 4 - 6) = 120; for 3 or more we add ((1760 - 1700) - 4 - 6) + ((1760 - 1500) - 4 - 6) + ((1760 - 1600) - 4 - 6) = 450
LotOrderBuy1 = 0.01; LotsS = 0.01
LotOrderBuy2 = 0.02; LotsS = 0.03
LotOrderBuy3 = 0.03; LotsS = 0.06
Total Lot LotsS = LotOrderBuy1 + LotOrderBuy2 = 0.03; for 3 or more we add
And here we need to understand how many lots we need to pass, what would eat 120 points or the sum of the profit in money.
To get StopProfit
Ask - StopProfit * Point = LineTakeProfit for OrderBuy1 and LineStopLoss for OrderBuy2
LotsS = 0.06
That's how I see it.
Try using this function - OpenPosition() function for online.
Thank you very much. The idea is clear, I will try it.
Can anyone clarify this point. Here is the link https://www.mql5.com/ru/code/8102. The script (Expert Advisor attached) . Why when you calculate anything in the same excel file (CSV) when you close it (of course writes where to save - I click in the same file (instead)) and when you reopen the terminal and the file all calculations disappear???
It's working!!!! =))))) really not as it should be, but I'm very pleased =))) my deepest gratitude =))))
count between orders: ((Ask - OrderBuy2) - swop - ...) + ((Ask - OrderBuy1) - swop - ...) = Profit, we get the number of points that we can lose as they are on the plus side
((Ask - OrderBuy3) -/+ swop -/+ ...) + ((Ask - OrderBuy2) - swop - ...) + ((Ask - OrderBuy1) - swop - ...) = Profit
Ask = 1620; Ask = 1760; OrderBuy3 = 1700
((1620 - 1500) - 4 - 6) + ((1620 - 1600) - 4 - 6) = 120; for 3 or more we add ((1760 - 1700) - 4 - 6) + ((1760 - 1500) - 4 - 6) + ((1760 - 1600) - 4 - 6) = 450
LotOrderBuy1 = 0.01; LotsS = 0.01
LotOrderBuy2 = 0.02; LotsS = 0.03
LotOrderBuy3 = 0.03; LotsS = 0.06
Total Lot LotsS = LotOrderBuy1 + LotOrderBuy2 = 0.03; for 3 or more we add
And here we need to understand how many lots we need to pass, what would eat 120 points or the sum of the profit in money.
To get StopProfit
Ask - StopProfit * Point = LineTakeProfit for OrderBuy1 and LineStopLoss for OrderBuy2
LotsS = 0.06
This is how I see it
I've seen the answer to your question once. I'll even find it now. Here:
How to calculate how many points (in points) price can go down in negative market conditions?
link formula: Lot=Money/(Stoplos*Tick)
Money - earned/lost
Stoplos - in broker points
Tick - MarketInfo(Symbol(), MODE_TICKVALUE)
From here, spin as you like:
Stoplos=Money / (Lot*Tick)
Money=Lot*Stoplos*Tick
If you want to check this one, you may use it as well:
Calculation of CUE level for a set of one instrument:
total lots = total position (SP)
value of tick = ST
SP profit = ST
The formula for calculation is quite simple:
KP = PSP / (ST * SP)
In which we find out the number of pips(KP) to the CU level relative to the current price(TP) of the symbol.
And by substituting KP into the formula CU = TC - KP * Point we get the CU price level.
Depending on the direction of the JV, you choose whether to add or subtract from the TC.Terminal does not see history