Register Login
Forums    February 6, 2012
TradersStudio Forums
'thisSession' NULL object error in custom report
Last Post 08-18-2009 06:45 PM by Andrew Papp-Csatari. 14 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Andrew Papp-Csatari
New Member
New Member
Posts:6

--
07-24-2009 04:05 PM

    I have written a myCustomReport() Sub but I get the following error:

     Dim objSum As TSProcessor.ISummary

    objSum = thisSession.Summary

    Error: "trying to call method of NULL object"

    myCustomReport() is called by myChannelBreakout() session script on the last line. Any ideas? Thanks!

    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    07-24-2009 04:36 PM

    I am not sure, it working in the beta of professional.

    I don't have old 2.5.5 handy.

     

    Andrew Papp-Csatari
    New Member
    New Member
    Posts:6

    --
    07-24-2009 05:05 PM
    I'm running 2.9.5 Professional
    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    07-25-2009 12:23 PM
    Posted By murray on 07-24-2009 4:36 PM

    I am not sure, it working in the beta of professional.

    I don't have old 2.5.5 handy.

    Note Murray

    Is this a run time error or when you save the code



    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    07-25-2009 12:23 PM
    Posted By murray on 07-24-2009 4:36 PM

    I am not sure, it working in the beta of professional.

    I don't have old 2.5.5 handy.

    Note Murray

    Is this a run time error or when you save the code



    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    07-25-2009 12:23 PM
    Posted By murray on 07-24-2009 4:36 PM

    I am not sure, it working in the beta of professional.

    I don't have old 2.5.5 handy.

    Note Murray

    Is this a run time error or when you save the code



    Andrew Papp-Csatari
    New Member
    New Member
    Posts:6

    --
    07-25-2009 12:48 PM
    This is a run-time error when I run the session. The code validates and saves fine. Thx!
    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    07-25-2009 11:21 PM
     Let me look into it. Send me an example which I will try to get working or find a work around and I will either post here or if you want you can e-mail me at Murray@TradersStudio.com and I will look at it and send you a work around. I think these features work from TradePlans and Macro's ,they should work from Sessions. If they don't I need to get that fixed.
    Andrew Papp-Csatari
    New Member
    New Member
    Posts:6

    --
    07-27-2009 11:55 AM

    Hi Murray.

    Thanks for looking into this. Here is the sample code that is meant to compare session performances (simplified to remove clutter). The error is seen when the Session is run. The code saves/validates fine. Let me know if you find a fix or workaround.

    ' Session code:

    Sub SYS_chan_break(modeTradeRisk, atrLen, atrOffset As Integer)
        MinMove = GetActiveMinMove()
        Hi = Highest(High, Slen, 0)
        Lo = Lowest(Low,  Slen, 0)
        atr = Average(TrueRange, atrLen, atrOffset)

        ' Calculate trade risk based on test parameter setting.
        Select Case modeTradeRisk
            Case 0

                tradeRisk = (Hi - Lo)
            Case 1
                tradeRisk = (atr * 3)
            Case Else
                Print "Invalid modeTradeRisk: ", modeTradeRisk
                StopRun
        End Select
       
        ' Set trade risk.
        If (tradeRisk > 0) Then
            SetTradeRisk(tradeRisk)
        End If
       
        ' Place order.
        Buy ("ChanBuy",  1, Hi + MinMove, Stop, Day)
        Sell("ChanSell", 1, Lo - MinMove, Stop, Day)
       
        customExpectancyReport()
    End Sub

     

    ' Custom Report Code:

    Sub customExpectancyReport()    
       ' This results in error: "trying to call method of NULL object"
        Dim objSum As TSProcessor.ISummary
        objSum = thisSession.Summary

       ' I've also tried these with NO success:

        ' Dim objSes As TSProcessor.ISession

        'objSes = thisSession or objSum = TradePlan.Session(0)
        'objSum = objSes.Summary

        ' Calculate and print custom stats (ex. expectancy, opportunity, expectancy-score, etc.) calculated based on the objSum attributes
    End Sub

    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    07-29-2009 08:34 AM
    I am out of town. Can I take a look at it Friday ?
    Andrew Papp-Csatari
    New Member
    New Member
    Posts:6

    --
    07-29-2009 02:25 PM
    Friday sounds good - Thanks! Looking forward to a fix.
    Thomas Stridsman
    New Member
    New Member
    Posts:9

    --
    08-11-2009 12:03 PM
    Wow!
    What is going on? Version 2.9.5 professional?! How come I am still chugging along with 2.5.5 and can find no info on how to upgrade? What gives???
    /T
    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    08-11-2009 12:21 PM

    If you either purchased 2.5 as your last paid version or are a gold or platinum member you can request a beta agreement for the professional version.

      I has been delayed because I keep adding things to it as I find I need them for the money management program I am currently working on. We have about 30 million under management currently. 

     I have finally drawn a box around it and am only fixing bugs. realisticly, Pro will have a offical release somewhere around Nov 1. It could be earlier.

     

     

    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    08-11-2009 01:59 PM

    It just occurred to me that thissession objects , not all of them are valid. Results ones are not because they assume all markets have been run. Please look at using ThisMarket those objects should all work. You can take the results summary from thismarket.

     

     

    Andrew Papp-Csatari
    New Member
    New Member
    Posts:6

    --
    08-18-2009 06:45 PM

    Hi Murray,

    If I understand your suggestion, wouldn't this mean adding more logic into the custom report to find out the markets traded by the session, and computing ALL the aggregate attributes, etc.? Are you suggesting to do this every iteration or at the end? This seems to reimplement what the iSession should be doing. Let me know if I misunderstood your point, or if you have other suggestions to try.

    Did anyone get this functionality working? Care to share the code segment? Thx!

    You are not authorized to post a reply.


     TradersStudio, Inc. ® Copyright 2004-2012 All Rights Reserved   Terms Of Use  Privacy Statement