Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

how to sell limit on the moving average

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to sell limit on the moving average

    Hi, i'm constructing a script based on the moving average, basicly, when 2 moving average cross to the upside buy... but i don't want to buy at the market (EnterLong) but after a pull back on the fast moving average... i tried to write a EnterLongLimit like that but it doesn't work :

    EnterLongLimit (1, SMA(21), "Entry Long")

    i want than my limit order moves with the fast moving average...

    how can i do ?
    thx for answers

    #2
    Hi Thomas, could you tell me what error message you're getting?

    Just a quick guess, but could you also try EnterLongLimit(1, SMA(21)[0], "Entry Long")?
    AustinNinjaTrader Customer Service

    Comment


      #3
      The error code is CS1502 and CS1503

      i already tried to write EnterLongLimit(1, SMA(21)[0], "Entry Long") but the problem is that the order don't move up with the moving average, i mean that the order is fill only if the market hit the moving average during the [0] period... but if the market hit the moving average 2, 3, 4 periods after, the moving average rose but not the order. that's my problem

      Comment


        #4
        Thomas, I think I might have an idea as to why it is not trailing, but to test my theory, I'd need to see the relevant sections of code. Could you please post the code? You could just email it to [email protected] attn Austin if you'd like.
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        4 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        40 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        19 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X