viktoriopablo:
I want to place an order with 100 euro, and I want to set the stop loss to 10 euros, and set the take profit to 5 euros. But as I see the OrderSend method requires lots for placing the order, and levels for stop loss and take profit. And my problem is: how to calculate these values based on the euro amounts I want to set?
- Risk depends on your initial stop loss, lot size, and the
value of the pair. You place the stop where it needs to be - where the reason
for the trade is no longer valid. E.g. trading a support bounce the stop goes
below the support. Only then can you calculate lot size.
- In MT4code:
- You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
- Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)
-
Do NOT use TickValue by itself - DeltaPerLot
and verify that MODE_TICKVALUE is returning a value in your deposit
currency, as promised by the documentation, or whether it is returning a value
in the instrument's base currency.
MODE_TICKVALUE is not reliable on non-fx instruments with many brokers. - You must normalize lots properly and check against min and max.
- You must also check FreeMargin to avoid stop out
- Use a GUI EA like mine (for MT4): Indicators: 'Money Manager Graphic Tool' indicator by 'takycard' Forum - Page 6
- In MT4code:
- SL/TP level are prices.
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
I am a little bit new in this language, but I have the basics.
I want to trade EUR/USD, and my account is in EUR. I have 1000 EUR in my account.
What I want: open a position with stop loss and take profit.
I want to place an order with 100 euro, and I want to set the stop loss to 10 euros, and set the take profit to 5 euros. But as I see the OrderSend method requires lots for placing the order, and levels for stop loss and take profit.
And my problem is: how to calculate these values based on the euro amounts I want to set?
I searched for some lot-pip-etc calculation on the web, but after all what I tried did not work. This is how I wanted to calculate:
And are the stoploss and takeprofit levels also lots? Or are they different units?
And it is not really clear that what is the stoploss and takeprofit in the OrderSend() method. I know it is called Level, but what is it actually, what do I need to set there? I guess not 5€ and 10€, I think I need to calculate them somehow if I want the result to be 5€ for takeprofit and 10€ for stoploss.
I can't believe that it is so hard to calculate the lot and the other two based on the result I want in euro.