Bug: SL/TP in alerts are treated as point distance instead of price (causing wrong risk % sizing)

Hello Support,

I’m sending TradingView alerts like:

buy US30 sl=45201.33 tp=45580.63 q=1%

My intention is to set the stop-loss at the price 45,201.33 with an account balance of 19704.

However, in the MT5 Expert logs, I see:

Calculating Risk Value: 0.010000 SL: 4520133.00000 balance: 197.0447000

Order: US30 tp=45580.630000 sl=45201.330000 m=0 e=0

This shows the EA is interpreting the SL price as 4,520,133 points, instead of the distance from the entry price to the stop-loss level.

As a result, position sizing is wrong when using % risk.

This results in a trade being open with a 0.01 lot size.

Symbol on broker is US30

Could I get some assistance on how to resolve this issue?

Hello @antrich9

When using the Q as a percentage with the SL in your command, the lot size is calculated in such a way that you will lose the percent defined in the Q parameter if your stop loss is hit.

Example: BUY EURUSD Q=1% SL=1.1200 - If the stop loss is hit, the loss will be 1% of the account balance.

So, in this case, the balance you see in the logs is the amount you will lose if the stop loss is hit.

The Stop Loss and Take Profit are placed correctly as specified in your command. You can check this in the Trade tab.

If the calculation is done and the resulting lot size is lower than the minimum allowed lot size by the broker, the trade is placed with the broker’s minimum lot size.

Tash.

@Tash I think you missed what @antrich9 problem is.

I stand corrected:

My SL and TPs are in points instead of the absolute price

@antrich9 is trying to set a SL at point X but the EA thinks the point X are number of pips/points. This happens when you do not pass a decimal point in your param value. In your complaint, you mentioned that the stop loss has a .33 but I see in your description the point is not detected. That could be because in your real alert it is not there.

Can you verify this and update accordingly.

If you check the logs during the calculations, it is true you will see what he is explaining even when passing the price with a decimal.

@antrich9 Could you please let us know if your problem was solved?

@Tash - Issue still remains for myself - unfortunately, I do not have any up-to-date examples to share due to manually entering trades.

Based on the issue being due to the minimum lot size allowed for the broker - this was on a FTMO account - which minimum lot size 0.01

@Lucem - The alert i shared is from my telegram history - so the inclusion of the decemial points was sent at time of the alert.

buy US30 sl=45201.33 tp=45580.63 q=1%