Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Same source of data, different values in strategy

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

    #16
    help

    i read it all and set the bar if(BarsInProgress == myInput0).

    bet is recalculed each time but same Print(lastTrade.ProfitCurrency +" "+ lastTrade.Quantity); outputs twice in row. help.

    Comment


      #17
      Originally posted by Synax.one View Post
      i read it all and set the bar if(BarsInProgress == myInput0).

      bet is recalculed each time but same Print(lastTrade.ProfitCurrency +" "+ lastTrade.Quantity); outputs twice in row. help.

      What is myInput0 set to at the time it runs twice?

      If you change the code to BIP == 0, how many times are the Print() functions called? Only once, or multiple times?
      MatthewNinjaTrader Product Management

      Comment


        #18
        myinput 1 with bid prices in strategy analyzer or 2 with ask prices. bip == 0 also bet variable recalculated but Print(lastTrade.ProfitCurrency +" "+ lastTrade.Quantity); is printing with "same values each time" for two times. my mistake: print is called once in one call of onbarupdate function. do you understand ?
        Last edited by Synax.one; 04-27-2012, 06:19 AM.

        Comment


          #19
          Hello,

          Yes, I understand. Since you added the additional bid/ask data, OBU will be called for each series. If you only want the results to print once, you will need to work the Print() functions in the context of BIP == 0.

          Please try running the following exercise to understand what is occurring to get the results you are loooking for:

          Code:
          Print("BIP: " + BarsInProgress + " " + Time[0].ToString());
          You can then specify which BIP is called by creating a filter of BIP = 0, BIP = 1, BIP = 2
          MatthewNinjaTrader Product Management

          Comment


            #20
            LOOK: different last bet, same profit. same problem. please help me.

            1: 0: 10 0 ; 0 0
            BIP: 1 30. 8. 2009 23:18:18
            1: 0: 10 1 ; 0 0
            BIP: 1 30. 8. 2009 23:18:28
            -0,000199999999999978 10000
            1: -1,99999999999978: 8,00000000000022 1(last bet) ; -1,99999999999978(last profit) 1
            BIP: 1 30. 8. 2009 23:20:35
            -0,000199999999999978 10000
            1: -3,99999999999956: 6,00000000000044 0,640000000000035(different last bet) ; -1,99999999999978(last profit again same) 1
            BIP: 1 30. 8. 2009 23:23:54
            0,000100000000000211 6400
            1: -3,35999999999821: 6,64000000000179 0,360000000000053 ; 0,640000000001351 2
            BIP: 1 30. 8. 2009 23:25:11
            0,000100000000000211 6400
            1: -2,71999999999686: 7,28000000000314 0,440896000000238 ; 0,640000000001351 2
            BIP: 1 30. 8. 2009 23:25:22
            -0,000100000000000211 4408
            1: -3,16079999999779: 6,83920000000221 0,529984000000457 ; -0,44080000000093 3
            BIP: 1 30. 8. 2009 23:25:28

            Comment


              #21
              You would need to continue adding prints until you find what is the code flow in your code and why the value you are getting is not what you expect.

              Unfortunately we are only able to go so far to help in debugging and get up and going with the program. You may need to have a NinjaScript consultant take a look at the code to see where your coding error is.

              If you have added more prints and still cannot isolate the problem please post the code once more we will give it one run on our side to see if we can isoalte anything simple that is missing.

              -Brett
              BrettNinjaTrader Product Management

              Comment


                #22
                i recognized that first trade was at 23:06:15 and data starts from 21:00. it doesnt make sense. how can i read all data tick by tick from first day of data. thanks
                Last edited by Synax.one; 04-27-2012, 09:43 AM.

                Comment


                  #23
                  Hello,

                  Not sure what you are exactly asking but when I need to debug something I add Prints(0 and use this guide for debugging.

                  BrettNinjaTrader Product Management

                  Comment


                    #24
                    thank you. synax

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    648 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    369 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    108 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    572 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    573 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X