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

I lost but Robot won how?

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

    I lost but Robot won how?

    I have one strategy builder file that does trades
    and one that draws the take profit (light green) and stops loss (dark green)

    I was trading live today, and I lost
    when the tick passed the dark green area, it took my stop loss

    but the robot won. I don't understand how

    the logic is fine, the robot waited for the red candle to close, then it tested the logic
    Default input[0] <= StopLoss then ExitLong

    I calculate by close, if I calculate by "On each tick", then the robot will see my stop loss?

    how can I get the robot to see the tick price?
    Attached Files
    Last edited by AaronKoRn; 05-19-2021, 10:28 PM. Reason: clarity

    #2
    Hello AaronKoRn,

    From the details it sounds like you are running two separate strategies, is that correct?

    If so there is the possibility that the two would work differently when run side by side. They also should not be able to communicate, for example a second strategy will not observe any of the orders from the first strategy.

    The OnEachTick setting would allow the strategy to process its logic for each tick. If you have programmed the strategy in a way that works with OnEachTick Processing you could try that as well.

    ​​​​​​​Please let me know if I may be of additional assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Yes I have 2 strategies. I dont need them to communicate.

      I just need the trade robot strategy to see the tick price

      how would I do something like

      if Tick Price > EMA(21) then Exit Long

      I know how to do the EMA, and Exit part but not the Tick Price
      Attached Files

      Comment


        #4
        Hello AaronKoRn,

        You could use OnEachTick processing for that. In the condition you can reference the Close price of 0 BarsAgo and that would be the current price in realtime.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          I tried that, but when send the exit signal it looks like it is still waiting for the bar to close.

          im using the basic exit shot option

          there are others, limit, market, e.t.c

          which one should I use?

          Comment


            #6
            Hello AaronKoRn,

            Have you tried using a Print as an action to confirm the condition is become true on each tick? You could add a print as an action along with the exit and then use the NinjaScript output window to see in realtime when the condition is true.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kaywai, Today, 06:26 AM
            1 response
            6 views
            0 likes
            Last Post kaywai
            by kaywai
             
            Started by ct, 05-07-2023, 12:31 PM
            6 responses
            205 views
            0 likes
            Last Post wisconsinpat  
            Started by kevinenergy, 02-17-2023, 12:42 PM
            118 responses
            2,780 views
            1 like
            Last Post kevinenergy  
            Started by briansaul, Today, 05:31 AM
            0 responses
            10 views
            0 likes
            Last Post briansaul  
            Started by traderqz, Yesterday, 12:06 AM
            11 responses
            28 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X