Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem of entry

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

    Problem of entry

    Hi,

    Sorry: I always have problems.

    I want sell when the current bid price is equals the previous price close, but the formula does not work. Someone know me indicate the error?

    if(GetCurrentBid() == Close[1])
    EnterShort();

    Thank

    #2
    germano, you're welcome - is this for backtesting or realtime trading? In backtesting GetCurrentBid() would be replaced with the Close value, so you this might be different from what you expect - http://www.ninjatrader-support.com/H...urrentBid.html

    Comment


      #3
      Bertrand, thank you for your reply. It is for realtime trading.

      Comment


        #4
        Ok, then please post the full code you have now, in a quick test I got realtime executions for long and short trades using live ES data. Do you notice any errors in the Log tab of the Control Center?

        Comment


          #5
          The strategy works, but opens the trade to the bid price corresponding to the closure of many candles ago and not to the closure of the previous candle.

          Comment


            #6
            That would depend on how you had it coded in, your example would take the Close one bar ago as reference and then place the trade on the next bar open with CalculateOnBarClose set to true. Are you talking about this 'delay'? If not, then please post a screenshot to illustrate what you see - thanks!

            Comment


              #7
              I would add a picture

              Comment


                #8
                Ok looking forward to it - if it's too big for posting just send it to support at ninjatrader dot com Attn Bertrand (if it's under 3 MB, otherwise YouSendIt to our email would be great)

                Comment


                  #9
                  Mmh... Sorry so!

                  Comment


                    #10
                    Please check your PM's - thanks!

                    Comment


                      #11
                      I'm doing a little confusion by sending . Sorry I do not understand the e-mail address.

                      Comment


                        #12
                        Then please use the one I send you as private message here in the forums, you can directly click on this one and your email program will pick it up, thanks!

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by argusthome, 03-08-2026, 10:06 AM
                        0 responses
                        91 views
                        0 likes
                        Last Post argusthome  
                        Started by NabilKhattabi, 03-06-2026, 11:18 AM
                        0 responses
                        48 views
                        0 likes
                        Last Post NabilKhattabi  
                        Started by Deep42, 03-06-2026, 12:28 AM
                        0 responses
                        31 views
                        0 likes
                        Last Post Deep42
                        by Deep42
                         
                        Started by TheRealMorford, 03-05-2026, 06:15 PM
                        0 responses
                        34 views
                        0 likes
                        Last Post TheRealMorford  
                        Started by Mindset, 02-28-2026, 06:16 AM
                        0 responses
                        69 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Working...
                        X