Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Delta Buy/Sell Volume

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

    We have not been carefully following this thread as this seems to be a community effort so I am not sure what you mean exactly. As far as recording data, 7 records data in much the same way as 6.5.
    Josh P.NinjaTrader Customer Service

    Comment


      Hey josh, I tried PM'ing and emailing you but it wont allow it anymore, how do I send you a message?

      Comment


        Thanks for the updated algorithms for volume and tick bars. I am using NT7 and my GomCD is functional. However, any indicators that rely on values from a GomRecorderIndicator derived class seem to result in this or a similar error: Error on calling 'OnBarUpdate' method for indicator 'GomCDHA' on bar 1: Object reference not set to an instance of an object.

        Comment


          rally,

          Please send an email to support [at] ninjatrader [dot] com with Attn: Josh in the subject line.
          Josh P.NinjaTrader Customer Service

          Comment


            This should work better :
            Attached Files

            Comment


              Originally posted by gomifromparis View Post
              This should work better :
              No luck for me same message :-(, I'm on NT7

              Comment


                No luck here either. Indicators like GomCDHA are not able to call GomRecorderIndicator derived classes like GomCD without getting that error. Debugging shows that fm is null. Maybe initialize is not being called correctly.
                Last edited by honvl; 11-05-2009, 11:52 PM.

                Comment


                  I was able to do some debugging with Visual Studio to solve the problem. It turns out that Instrument was null, and so because of the Instrument != null check inside GomRecorderIndicator's Initialize method, a lot of lines were being skipped. To fix the problem, I moved all of those lines to the beginning of the OnBarUpdate method and added a boolean flag to make sure they only run once.

                  Comment


                    Originally posted by PrTester View Post
                    No luck for me same message :-(, I'm on NT7
                    Do you mean GomCD doesn't work at all ? or only derived indicators ?

                    Comment


                      Originally posted by honvl View Post
                      I was able to do some debugging with Visual Studio to solve the problem. It turns out that Instrument was null, and so because of the Instrument != null check inside GomRecorderIndicator's Initialize method, a lot of lines were being skipped. To fix the problem, I moved all of those lines to the beginning of the OnBarUpdate method and added a boolean flag to make sure they only run once.
                      There's a change with NT7 and it appears you can't instantiate another indicator in the Initialize() method or you'll run into the "'BarsInProgress' property can not be accessed from within 'Initialize' method" exception

                      So I guess we've got to use the method you've implemented : put the code in the OnBarUpdate() with a test with bool flag.

                      See http://www.ninjatrader-support2.com/...ad.php?t=22023 for exact same issue.

                      Comment


                        Originally posted by gomifromparis View Post
                        Do you mean GomCD doesn't work at all ? or only derived indicators ?
                        Thank you, just move the code from Initialize to OnBarUpdate on both file and that fix my situation, Thanks to the debugging team :-)

                        Regards

                        Comment


                          I'm still having an issue calling a GomCD(___).DeltaClose[0] value into another indicator / strategy. Would someone mind posting an example of the code that needs to be moved from the initialize to onbarupdate section?

                          I thought I moved the correct code, but still not working for me.

                          Thanks.

                          Comment


                            Originally posted by Pepperdog View Post
                            I'm still having an issue calling a GomCD(___).DeltaClose[0] value into another indicator / strategy. Would someone mind posting an example of the code that needs to be moved from the initialize to onbarupdate section?

                            I thought I moved the correct code, but still not working for me.

                            Thanks.
                            You need to move from both indicators, GomCD and the Recorder, move the reference " Instrument != null " from Initialize to OnbarUpdate.

                            Comment


                              Originally posted by Pepperdog View Post
                              I'm still having an issue calling a GomCD(___).DeltaClose[0] value into another indicator / strategy. Would someone mind posting an example of the code that needs to be moved from the initialize to onbarupdate section?

                              I thought I moved the correct code, but still not working for me.

                              Thanks.
                              I think the correct way is to mo move all the code that instantiates GomCD indicators to the OnBarUpdate, but this has to be done only once so you need a flag to do that

                              example :

                              Code:
                              [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]class[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] GomCDSMA : Indicator[/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
                              [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]#region[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] Variables [/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New] Indicator indic;[/FONT][/SIZE]
                              [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] bool[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] initdone=[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]; [/SIZE][/FONT]
                              [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]#endregion[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
                               
                              [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] Initialize()[/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
                              [SIZE=2][FONT=Courier New] Add([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] Plot(Color.FromKnownColor(KnownColor.Orange),  PlotStyle.Line, [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"GCDSMA"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]));[/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New]CalculateOnBarClose = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New] Overlay = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New] PriceTypeSupported = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]; [/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
                               
                              [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] OnBarUpdate()[/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New]{ [/FONT][/SIZE]
                              [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (!initdone)[/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New] {[/FONT][/SIZE]
                              [SIZE=2][FONT=Courier New]  indic=SMA(GomCD(Input,GomCDCalculationModeType.BidAsk,GomCDChartType.CumulativeChart,GomFileFormat.Binary,GomFilterModeType.None,[/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]).DeltaClose,[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]5[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]); [/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New]  initdone=[/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New] }[/FONT][/SIZE]
                               
                              [SIZE=2][FONT=Courier New] GCDSMA.Set(indic.Value[[/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]]);[/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
                               
                              [/SIZE][/FONT]
                              [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]#region[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] Properties[/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New][Browsable([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])] [/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New][XmlIgnore()][/FONT][/SIZE]
                              [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] DataSeries GCDSMA[/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
                              [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] get[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] { [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] Values[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]]; }[/SIZE][/FONT]
                              [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
                              [/SIZE][/FONT]

                              Comment


                                I still can't get GomCD(___).DeltaClose[0] to work in another indicator even though GomCD and GomRecorder are working. When I try using the sample GomCDSMA, I get the error message :

                                "Error on calling 'OnBarUpdate' method for indicator 'GomCDSMA' on bar 0: Object reference not set to an instance of an object."

                                This happens both when I move the "Instrument != null" block to OnBarUpdate or leave it in Initialize in GomCD and GomRecorderIndicator.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by AaronKoRn, Yesterday, 09:49 PM
                                0 responses
                                11 views
                                0 likes
                                Last Post AaronKoRn  
                                Started by carnitron, Yesterday, 08:42 PM
                                0 responses
                                10 views
                                0 likes
                                Last Post carnitron  
                                Started by strategist007, Yesterday, 07:51 PM
                                0 responses
                                11 views
                                0 likes
                                Last Post strategist007  
                                Started by StockTrader88, 03-06-2021, 08:58 AM
                                44 responses
                                3,981 views
                                3 likes
                                Last Post jhudas88  
                                Started by rbeckmann05, Yesterday, 06:48 PM
                                0 responses
                                9 views
                                0 likes
                                Last Post rbeckmann05  
                                Working...
                                X