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 timmbbo, Today, 08:59 AM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by KennyK, 05-29-2017, 02:02 AM
        2 responses
        1,281 views
        0 likes
        Last Post marcus2300  
        Started by fernandobr, Today, 09:11 AM
        0 responses
        2 views
        0 likes
        Last Post fernandobr  
        Started by itrader46, Today, 09:04 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by bmartz, 03-12-2024, 06:12 AM
        5 responses
        33 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Working...
        X