No short positions established

Forums ProRealTime English forum General trading discussions No short positions established

Viewing 4 posts - 1 through 4 (of 4 total)
  • #240638

    Below is a script I created to go short if the close crosses under EMA10. I’m using a 15-minute chart for Nasdaq100, with a target and stop loss of 100 points. However, no positions are ever being established. Does anyone understand why? Thanks in advance 🙂

     

    DEFPARAM FlatAfter= 215900 // Cancel any pending orders, close any positions and prevent placement of additional orders by the trading system after 16:00:00 in the market time zone
    DEFPARAM CUMULATEORDERS=FALSE

    indicator1 = ExponentialAverage[10](close)

    c1 = close < indicator1 and close[1] > indicator1

    IF not onmarket and time =1430000 OR (time > 143000 AND time[1] < 143000) and c1 THEN
    entry = close
    SELLSHORT 1 CONTRACTS AT MARKET
    ENDIF

    indicator10 = ExponentialAverage[10](close)

    c10 = close CROSSES OVER indicator10
    c11= close <= entry-100
    c12 = close >= entry+100

    if c10 or c11 or c12 THEN
    EXITSHORT AT MARKET
    ENDIF

     

    #240639

    One too many zero’s for one of the times in the not onmarket  if statement    1430000 should be 143000

    1 user thanked author for this post.
    #240640

    Because TIME will never reach 1430000, and, it’s AND’ed  in the logic condition of the IF statement, the statement will never be TRUE, so no order will be executed.

    2 users thanked author for this post.
    #240664

    Thanks,  real rookie mistake _-)

    But: I get identical results for EMA10, EMA20 and EMA50…🤔

Viewing 4 posts - 1 through 4 (of 4 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login