Limit orders based on stop loss level
Forums › ProRealTime English forum › ProOrder support › Limit orders based on stop loss level
- This topic has 6 replies, 3 voices, and was last updated 1 year ago by robertogozzi.
-
-
04/24/2023 at 6:39 PM #213697
Hi everyone. I am very new at this, I tried and failed to set it up so I’m left with having to ask for help.
On the close of the signal candle I’d like to place a limit order based on a stop loss level.
For example, for a long, once the signal candle closes, I’d want my stop lets say 5 points beneath the low and would want to risk lets say 10 points. I’d get in if the market pulls back to the level or, limit order to turn to market order if price already lower. The option of a target would be a bonus.
Alternatively consider the range of the signal candle and then place a limit order on a percentage retracement.
Does anyone have the code for something like this?
Thank you in advance,
Catalin
04/25/2023 at 4:35 AM #213703You wrote “I’d want my stop lets say 5 points beneath the low and would want to risk lets say 10 points“. What if the distance from the current price and the low-5 points is higher than 10 points? Would you reduce the SL or ignore the signal without opening a trade?
Anyway, to set a stop loss 5 points beneath the low of the signal candle:
1234IF MyLongConditions THENBUY 1 Contract at MarketSET STOP PRICE low - 5*PipSizeENDIF1 user thanked author for this post.
04/25/2023 at 11:03 AM #213709I’m not sure, but when he said : “I’d want my stop lets say 5 points beneath the low and would want to risk lets say 10 points“, maybe he want to risk 2 lots : 2 x 5 pips = 10
04/25/2023 at 12:59 PM #21372004/25/2023 at 3:10 PM #213728There you go (not tested):
1234567891011IF OnMarket THENSL = 0ENDIFIF MyLongConditions THENSL = low - 5*PipSizeEntry = min(open,close) - 5*PipSizeSET STOP PRICE SLENDIFIF SL <> 0 THENBUY 1 Contract at Entry LIMITENDIF1 user thanked author for this post.
04/25/2023 at 7:15 PM #21374304/26/2023 at 12:04 PM #213770Append these two lines to your code, to plot both SL and ENTRY on your chart when backtesting:
12GraphOnPrice ENTRY coloured("Blue",255)GraphOnPrice SL coloured("Red",255)1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on