STOP/LIMIT Orders with SET STOP LOSS
Forums › ProRealTime English forum › ProOrder support › STOP/LIMIT Orders with SET STOP LOSS
- This topic has 25 replies, 2 voices, and was last updated 2 years ago by xxxsylar90xxx.
Tagged: .
-
-
06/21/2020 at 5:51 PM #136693
Hi guys!
Quick question with regards of STOP/LIMIT orders, I can’t find the answer in the manual.
Question: Is there a way to set the STOP LOSS already from the beginning when you add a STOP/LIMIT order to the market?
Ex: BUY 10 CONTRACT AT 10000 STOPThe reason for this is that I need to keep the margin cost low. By adding a STOP/LIMIT order without STOP LOSS the margin cost is too high. As soon as the order is executed I can set the STOP LOSS but since the order is valid the whole bar I have to cater for the higher margin cost without any stop loss entered.
Thanks in advance,
/Magnus06/21/2020 at 6:20 PM #136694Yes, you can set it as usual.
If the pending order is triggered, the last SET STOP LOSS will be the stop loss used for that trade and for ALL next trades until changed with another SET STOP LOSS.
06/21/2020 at 6:49 PM #136700Thanks for your quick reply robertogozzi!
So you mean that if I add the code:
SET STOP pLOSS 100
immediately after my STOP/LIMIT order the PRT will take the stop loss in consideration even before the order has been executed?
The problem when you don’t see the system livetrading, hard to see if it’s working as you say if it only adds the stop loss after. As I mentioned I need to lower my main cost for the pending orders.
06/21/2020 at 8:02 PM #136708Yes, it is recorded and will be used when needed.
04/25/2021 at 1:54 PM #167977Limit Order123456789101112DEFPARAM CUMULATEORDERS = FalseTimeframe (3 minutes, updateonclose)FOR n = 1 TO 4 DOc1 = abs (close[n]-open[n])NEXTc2= c1 >= 15c3 = c1/2c4 = open - c3Timeframe (default, updateonclose)IF c2 THENBUY 1 CONTRACT AT (c4) LIMITENDIFHi, I wanna write a code which allow to set a limit order if the condiction are solved. If i don´t write [n] on close and open the limit order doesn´t been execute, if i use For … To .. work only if n < of the period of condition on chart.
Working Code123456789Timeframe (3 minutes, updateonclose)c8 = abs (close[4]-open[4])c9= c8 >= 15c7 = c8/2c6 = open - c7Timeframe (default, updateonclose)IF c9 THENBUY 1 CONTRACT AT (c6) LIMITENDIFso work, but only why the condition appear afer 4 bars.
How can I do it?
Thanks
04/25/2021 at 2:09 PM #167979Both examples do the same thing.
The FOR…NEXT loop is useless.
What is exactly the condition you want to test?
04/25/2021 at 2:16 PM #167980LIMIT orders are to be used when your entry price is better than the current one. Use STOP orders if not.
04/25/2021 at 2:58 PM #167982I wanna place an buy limit order, always after an expansive bar >= 15 , and this order don´t have to disappear on the next bar, but it must be setted for the next 4 bars.
Thank you
04/25/2021 at 5:29 PM #167993This will account for Limit, Stop and Market orders and distance from current price (set distance=0 to disable it):
12345678910111213141516Timeframe (3 minutes, updateonclose)c8 = abs (close-open)c9= c8 >= 15*pipsizec7 = c8/2c6 = open - c7Distance = 10*pipsizeTimeframe (default)IF summation[4](c9) and Not OnMarket THENIf close > (c6+Distance) thenBUY 1 CONTRACT AT (c6) LIMITElsIf close < (c6 - distance) thenBUY 1 CONTRACT AT (c6) StopElseBUY 1 CONTRACT AT MarketEndifENDIF04/25/2021 at 6:13 PM #168000I try to explain it Better
Working on this case123FOR n = 1 TO 4 DOc1 = abs (close[n]-open[n])NEXTNot Working123FOR n = 1 TO 5 DOc1 = abs (close[n]-open[n])NEXTWhy if the condition is reached after 4 Bars doesn´t place the order to “for n = 1 to 5” ? I´ve tryed to use Break and While but it doesn´t work.
Thank you
04/25/2021 at 6:59 PM #168006The loop is useless. C1 will ALWAYS retain the condition of the last iteration.
They are equivalent to:
12c1 = abs(close[4]-open[4]) //first examplec1 = abs(close[5]-open[5]) //second example04/25/2021 at 8:35 PM #168009I tried both example
12c1 = abs(close[4]–open[4]) //first example Workc1 = abs(close[5]–open[5]) //second example Don´t WorkI need that if i Write [5] it work also if i after 4 bars the price reached the level of the 50% retraechment of the Expansive Candle.
Now it work only if i write [4] while in my case the price reached the level of the 50% retraechment of the Expansive Candle after 4 bars.
Or i must do this?
Sequence1234567891011121314151617181920212223242526272829303132333435363738394041Timeframe (3 minutes, updateonclose)c1 = abs (close[1]-open[1])c2 = c1 >= 15c3 = c1/2c4 = open - c3c1a = abs (close[2]-open[2])c2a = c1a >= 15c3a = c1a/2c4a = open - c3ac1b = abs (close[3]-open[3])c2b = c1b >= 15c3b = c1/2c4b = open - c3bc1c = abs (close[4]-open[4])c2c = c1c >= 15c3c = c1c/2c4c = open - c3cc1d = abs (close[5]-open[5])c2d = c1d >= 15c3d = c1d/2c4d = open - c3dIF c2 THENBUY 1 CONTRACT AT (c4) LIMITENDIFIF c2a THENBUY 1 CONTRACT AT (c4a) LIMITENDIFIF c2b THENBUY 1 CONTRACT AT (c4b) LIMITENDIFIF c2c THENBUY 1 CONTRACT AT (c4c) LIMITENDIFIF c2d THENBUY 1 CONTRACT AT (c4d) LIMITENDIFThank you
04/25/2021 at 8:55 PM #168012This is an indicator that draw a point where i want to place a limit order… I will make the same with the limit order trigger.
1234567c1 = abs ( close[1] – open[1] )c2 = c1 >=15c3 = c1/2IF c2 THENDRAWPOINT(barindex, open-c3, 5) COLOURED (225,0,225)ENDIFRETURNThank you
04/26/2021 at 12:05 PM #168054If you want to place a pernding order you have to check whether it’s a LIMIT or STOP order, as I told you.
Moreover, entry prices change each new bar.
04/26/2021 at 3:41 PM #168077This indicator (to be added ON the price chart) will show you how many entrues there will be rach bar:
12345678910FOR i = 1 TO 5c1 = abs(close[i] - open[i])c2 = c1 >= 15 * pipsizec3 = c1 / 2IF c2 THEN//DRAWPOINT(barindex, open-c3, 5) COLOURED (225,0,225)DRAWTEXT("---",barindex,open-c3,Dialog,Bold,20) COLOURED(0,255,0,255)ENDIFNEXTRETURNThis is the strategy modified to reduce the number of IF’s and to support the distance requirements (if DISTANCE <> 0):
1234567891011121314151617181920DEFPARAM CumulateOrders = FALSE//TRUETimeframe(3 minutes, updateonclose)Distance = 0 * pipsize //minimum distance between current price and entry priceFOR i = 1 TO 5c1 = abs(close[i] - open[i])c2 = c1 >= 15 * pipsizec3 = c1 / 2c4 = open[i] - c3IF c2 AND Not OnMarket THENIF (close - Distance) > c4 THENBUY 1 CONTRACT AT c4 LIMITELSIF (close + Distance) < c4 THENBUY 1 CONTRACT AT c4 STOPELSEBUY 1 CONTRACT AT MarketENDIFENDIFNEXTSET TARGET pPROFIT 60SET STOP pLOSS 20 -
AuthorPosts
Find exclusive trading pro-tools on