TIMEFRAME ( DAYLY) — CLOSE > OPEN
Forums › ProRealTime foro Español › Temas generales de Trading › TIMEFRAME ( DAYLY) — CLOSE > OPEN
- This topic has 1 reply, 2 voices, and was last updated 3 years ago by robertogozzi.
-
-
07/20/2021 at 7:12 PM #173914
Good afternoon,
Please I need help with the following code. I seek to enter the S & P500 bought when the market meets the following conditions:
– Bullish engulfing candle on Timeframe 5 minutes
– Daily timeframe: Price above the exponential average of 11 periods and closing of the previous day greater than the opening of the previous day.z EEUU 5 m 20/07/2112345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970// Definición de los parámetros del códigoDEFPARAM CumulateOrders = False // Acumulación de posiciones desactivadaTradeON = OpenDayOfWeek >= 1 AND OpenDayOfWeek <= 5noEntryBeforeTime = 090500timeEnterBefore = time > noEntryBeforeTimenoEntryAfterTime = 215500timeEnterAfter = time < noEntryAfterTimetimeframe(daily)c10 = (close > open)indicator11 = ExponentialAverage[12](close)c11 = (close >= indicator11)//5 minutetimeframe(default)c13 = Close[1] < Open[1] AND Open < Close[1] AND Close > Open[1]IF c10 and c11 and c13 and timeEnterBefore and timeEnterAfter and TradeOn and Not OnMarket THENBUY 1 SHARE AT HIGH STOPSET STOP pLOSS 20ENDIF//trailing stop functiontrailingstart = 20 //trailing will start @trailinstart points profittrailingstep = 5 //trailing step to move the "stoploss"//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIFI understand that the c10 condition should enter only if the close of the previous day is greater than the opening of the previous day but not that way. See images 04/23/21, on the 22nd the candle is red and it goes in the same way.
timeframe(daily)
c10 = (close > open)
I would appreciate if you tell me exactly what this line means and how I have to write to get what I’m looking for.
Thank you ,
regards07/20/2021 at 8:45 PM #173927Reemplace la línea 15 con:
1c10 = (close[1] > open[1])está utilizando precios de la vela actual.
-
AuthorPosts
Find exclusive trading pro-tools on