Saturday, September 04, 2010     | Register
TradersStudio Forums
Subject: 'thisSession' NULL object error in custom report

You are not authorized to post a reply.   
Author Messages
Andy123
Posts:6

07-24-2009 4:05 PM Alert 

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!

murray
Posts:519

07-24-2009 4:36 PM Alert 

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

I don't have old 2.5.5 handy.

 

Andy123
Posts:6

07-24-2009 5:05 PM Alert 
I'm running 2.9.5 Professional
murray
Posts:519

07-25-2009 12:23 PM Alert 
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



murray
Posts:519

07-25-2009 12:23 PM Alert 
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



murray
Posts:519

07-25-2009 12:23 PM Alert 
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



Andy123
Posts:6

07-25-2009 12:48 PM Alert 
This is a run-time error when I run the session. The code validates and saves fine. Thx!
murray
Posts:519

07-25-2009 11:21 PM Alert 
 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.
Andy123
Posts:6

07-27-2009 11:55 AM Alert 

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

murray
Posts:519

07-29-2009 8:34 AM Alert 
I am out of town. Can I take a look at it Friday ?
Andy123
Posts:6

07-29-2009 2:25 PM Alert 
Friday sounds good - Thanks! Looking forward to a fix.
Optisizer
Posts:9

08-11-2009 12:03 PM Alert 
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
murray
Posts:519

08-11-2009 12:21 PM Alert 

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.

 

 

murray
Posts:519

08-11-2009 1:59 PM Alert 

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.

 

 

Andy123
Posts:6

08-18-2009 6:45 PM Alert 

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.
Forums > TradersStudio 2.x > TradersStudio Basic > 'thisSession' NULL object error in custom report



ActiveForums 3.6
TradersStudio® Copyright 2004-2010 All Rights Reserved   |  Privacy Statement  |  Terms Of Use