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

Profit taken

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

    Profit taken

    Hi
    this might seem impossible. I want to set so if I have like 10 point gain or more, my least point gain is 10 point.

    I know you might say set trail stop but I don't want it to work like that. I want it to keep trading until I hit my selling point by using some indicator. But say if it gain 50 points but it won't sell, I want to make sure I would at least capture 10 point gain.

    Basically when I play 5m timeframe, by the time my bot sell, it wait till next candle and it can be late.

    Thank you

    #2
    Hello, thanks for posting.

    The best way to do that would be a SetTrailStop which will stay x ticks behind the market price. If you wanted some other behavior you would need to implement custom order movement logic with ExitLongLimt/ExitShortLimit. You can use the ChangeOrder method to change the order to the desired price level:

    https://ninjatrader.com/support/help...hangeorder.htm

    Best regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Ahh I was wonder what are those are for. Lol thank you.

      One question if you can help me. I set a trading time from 930am to 330pm and it work great. But when I set 7pm to 8am, I won't trade, im I doing something wrong?

      Comment


        #4
        Hi, thanks for your reply.

        If you add a Print method within your condition you can check if the condition is being reached e.g.

        if(<time fileter condition>)
        {

        Print("Making Trade");
        EnterLong();

        }

        Using Print methods should be a common part of the debugging process of all scripts:
        https://ninjatrader.com/support/help...html?print.htm

        Best regards,
        -ChrisL
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CharlesLower, Today, 10:29 PM
        0 responses
        2 views
        0 likes
        Last Post CharlesLower  
        Started by parkinsonbr, Today, 09:26 PM
        1 response
        2 views
        0 likes
        Last Post bltdavid  
        Started by Newgannon, Today, 06:34 PM
        0 responses
        3 views
        0 likes
        Last Post Newgannon  
        Started by connorgrant5, Today, 02:25 PM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by TraderElegante, Today, 12:25 PM
        3 responses
        27 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Working...
        X