Stoploss not put in place
Forums › ProRealTime English forum › ProOrder support › Stoploss not put in place
- This topic has 36 replies, 8 voices, and was last updated 10 months ago by ashehzi.
-
-
12/20/2023 at 1:50 PM #2255131234SELLSHORT 1.0 CONTRACTS AT myLevel limitSellPrice = TRADEPRICESET TARGET PLOSS sDistanceSET TARGET PPROFIT pDistance
I’ve above code in an algo and short trade just got executed. It set the profit but not stoploss. It has done both in the past so wondering how such msgs between IG and PRT get lost or not fired by PRT. You can see in the attached images.
12/20/2023 at 2:56 PM #22551812/20/2023 at 3:03 PM #22552012/20/2023 at 5:05 PM #225547I think you could send a technical report to PRT :
– As soon as you encounter the issue, go to the “Help” menu on the ProRealTime toolbar.
– Please assure that the window concerned by this issue is open.
– Click on “Help center”, then on “I have a technical problem”
– Choose the category “Automatic trading”
– Give the name of the code you are referring to.
– To benefit from a technical help, it i necessary to authorize the access to the crypted code. To give them a temporary access, please check the box “I authorize the decryption of the codes (…)”
– Give as many details as possible, explain the issue you are having in the text box and mention
– Click “Send report”12/21/2023 at 8:34 AM #22556312/21/2023 at 10:51 AM #225567hi, I did not know that one can place an order for limiting the losses with a “set target ploss” command, it must be something relatively new. yet I was now opening the programming manual and wow – in fact this possibility is offered. but I think one needs to read the description very carefully, it tells:
It is also possible to limit losses with a target order when a position is currently losing. The limit is then placed in the direction of the loss of the position:
SET TARGET LOSS x: A limit is placed at x units from the position entry price.so, it might be very important – that hint to “when a position is currently losing…” – that could mean that corresponding order is issued not at the same time when position is opened, but “later” – at the time when open position runs into losses. I did not test it, it’s only my thinking/guessing.
1 user thanked author for this post.
12/21/2023 at 10:56 AM #225568…while with the command “set stop loss” the stop loss order is really always placed at the time of position opening. at least myself I really never experienced a case after (thousands of trades executed) that it was not placed…
1 user thanked author for this post.
12/21/2023 at 12:03 PM #22557212/21/2023 at 4:09 PM #225579There is also the effect that the LAST “set target x y” cancels the previous “set target a b”. As far as I know it’s always the last “set stop…” or “set target…” that’s active. That explains to me why in your first example the stop wasn’t active (any more).
12/21/2023 at 5:11 PM #225583As far as I know it’s always the last “set stop…” or “set target…” that’s active.
Wim, do you mean that a set stop will cancel a set target and vise versa ?
(this is not really clear and I like to know, not having the experience this time)12/21/2023 at 8:08 PM #22558912/21/2023 at 9:00 PM #225594So you’re telling me below code must leave an order with target profit and stop loss
12345IF NOT LONGONMARKET AND LongCondition THENBUY 1.0 CONTRACTS AT myLevel limitSET STOP PLOSS lossDistanceSET TARGET PPROFIT profDistanceENDIFI am not sure it is doing all the time. I am still testing. My understanding any time above code gets executed, it must leave an order with stop loss and target profit limit and should not leave just an order without stop loss and target profit limit because it can adverse effects when the market moves fast.
12/21/2023 at 9:21 PM #225595I’ve below code running since yesterday. It left an order earlier in the day without stop loss and profit:
123456IF NOT ShortOnMarket AND TIMEOPERATE AND (BARINDEX > 1000) AND (ordersCount < maxOrders) THENSELLSHORT 1.0 CONTRACTS AT myLevel limitSellPrice = TRADEPRICESET STOP PLOSS myStopLossSET TARGET PPROFIT myTargetProfitENDIFPlease see attached
12/22/2023 at 12:29 AM #225601According to your screenshots, the order is still “pending”…
If your order has not been executed, there is no associated Stop Loss and Take Profit…
I tried your code and after the order was executed, the Stop Loss and Take Profit were immediately placed…
(Protection Stops and Target orders are linked to an open position and valid until the close of that position)
12/22/2023 at 9:21 AM #225607I get your point regarding the sequential nature of the steps. But if I leave a guaranteed order, it shows stop loss and target profit evening in pending state. Same is true for manual order placement but why not for algo order without guaranteed stop. Why it is not an anomaly? It guarantees slippage in news related movement where a second difference between 1st order placement and then stop loss placement can cause big losses.
-
AuthorPosts
Find exclusive trading pro-tools on