PROGRAMACION STOP LOSS – AYUDA
Forums › ProRealTime foro Español › Soporte plateforma ProRealTime › PROGRAMACION STOP LOSS – AYUDA
- This topic has 5 replies, 2 voices, and was last updated 4 years ago by
robertogozzi.
Tagged: trailing stop
-
-
07/13/2020 at 7:42 PM #139191
HOLA. QUIERO PROGRAMAR EL STOP LOSS DE UN SISTEMA, QUIERO QUE EL STOP LOSS INICIAL ESTE 1% DEBAJO DEL MINIMO DE LAS ULTIMAS 5 VELAS. Y QUE LUEGO DE QUE EL PRECIO DE LA ACCION SUBA UN 10% POR EJ, EL STOP LOSS SE CORRA AL PRECIO DE ENTRADA, Y DESDE AHI APLICAR TRAILING STOP DE X%. ¿ES POSIBLE O NO? MUCHAS GRACIAS!
07/13/2020 at 8:52 PM #139196NO escriba en mayúscula, excepto palabras simples u oraciones muy cortas para señalar algo.
Se considera que las mayúsculas son gritos cuando se habla, según netiquette.
Tiene poca educación y es más difícil de leer. Gracias 🙂
07/14/2020 at 12:01 PM #13923307/15/2020 at 4:59 PM #13936807/15/2020 at 5:34 PM #139369Este es mi código (no probado) para posiciones largas:
123456789101112131415161718192021222324If not OnMarket thenNewStop = 0EndifIf not OnMarket then //do not change while at marketStopLoss = lowest [5](low) * 0.99 //-1%EndifMyProfit = TradePrice * 1.1 //+10%Result = TradePrice * (1 + PositionPerf)If NewStop > 0 ThenMyProfit = NewStop * 1.05 //5% trailing stopIf close >= MyProfit ThenNewStop= MyProfitEndifEndifIf NewStop = 0 and OnMarket and Result >= MyProfit ThenNewStop = TradePriceEndifIf MyConditions and Not OnMarket thenBuy 1 contract at MarketSell at StopLoss STOPEndifIf OnMarket thenSell at max(StopLoss,NewStop) STOPEndif07/15/2020 at 11:13 PM #139387I edit my code above to correct a couple of errors.
This is a complete MTF version for both Long and Short trades:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354DEFPARAM CumulateOrders = false//timeframe(1 day,updateonclose)CondL = close > average[200] AND average[10] CROSSES OVER average[20]CondS = close < average[200] AND average[10] CROSSES UNDER average[20]//timeframe(default)If not OnMarket thenNewStop = 0EndifIf not OnMarket then //do not change while at marketStopLossL = lowest [5](low) * 0.99 //-1%StopLossS = highest [5](low) * 1.01 //+1%EndifIF LongOnMarket THENMyProfit = TradePrice * 1.10 //+10%Result = TradePrice * (1 + PositionPerf)ELSIF ShortOnMarket THENMyProfit = TradePrice * 0.90 //-10%Result = TradePrice * (1 - PositionPerf)ENDIFIf NewStop <> 0 ThenIF LongOnMarket THENMyProfit = NewStop * 1.02 //2% trailing stopIf close >= MyProfit ThenNewStop= MyProfitEndifELSIF ShortOnMarket THENMyProfit = NewStop * 0.98 //2% trailing stopIf close <= MyProfit ThenNewStop= MyProfitEndifENDIFEndifIf NewStop = 0 THENIF LongOnMarket and Result >= MyProfit ThenNewStop = TradePriceELSIF ShortOnMarket and Result <= MyProfit ThenNewStop = TradePriceENDIFEndifIf CondL and Not OnMarket thenBuy 1 contract at MarketSell at StopLossL STOPEndifIf CondS and Not OnMarket thenSellShort 1 contract at MarketExitShort at StopLossS STOPEndifIf OnMarket thenSell at max(StopLossL,NewStop) STOPExitShort at min(StopLossS,NewStop) STOPEndifSET TARGET pPROFIT 50 -
AuthorPosts
Find exclusive trading pro-tools on