Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Utilize Market Analyzer Columns and Alerts to Automate Twitter Share Service Posts

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

    Utilize Market Analyzer Columns and Alerts to Automate Twitter Share Service Posts

    I would like to trigger automatic posts to my configured (private) Twitter Share Service throughout the course of the day (say, once per hour). The data I wish to post include AccountItem data and SystemPerformance data so I have been investigating creating the necessary columns in a Market Analyzer window. The Market Analyzer window would then have associated configured Alerts with the hourly condition as a trigger and the message post as the action inclusive of the property screenshotType == Window.

    I don't know whether this is the best way in which to accomplish my objective or not... hence, I wanted to ask.

    In a perfect scenario I would just drop code into my Strategy that would capture the Trade Performance window (which is configured to my liking) and share that output. However, the Trade Performance window does not have the ability to add Alerts to it so that pathway is moot and on the programmatic front I note that the Share() method takes screenshotPath as its visual parameter and the whole point of the exercise is that I want the platform to do the work without the need for myself to continuously generate screenshots...

    Maybe I'm missing something really simple and I'm overcomplicating the whole thing (which is actually my hope!) but if in fact I do have to go down the more convoluted Market Analyzer path how do I point SystemPerformance to my desired Strategy so that I am getting the correct figures? From the documentation it seems to me that SystemPerformance is demonstrated as being utilized within the Strategies/Strategy namespace/class itself and in my case I would be calling it from the MarketAnalyzerColumn(s) namespace/class.

    #2
    Hello TheFil,

    Thank you for your post.

    A few issues here. First, there wouldn't be a simple way to get SystemPerformance for a strategy in a Market Analyzer column, though it may be possible I would think to add an Account property, and look at the strategies in Account.Strategies that have the same Instrument as the MAColumn. This wouldn't be supported and we wouldn't have any examples for that, however.

    As far as generating a screenshot from code, there's not anything super simple to do that, but you could take a look at these two forum posts with some examples:




    The other problem with taking a screenshot of the Trade Performance window from the strategy itself would be that the Trade Performance does not automatically update and you have to hit the generate button to see new trades.

    I do actually think the MA Column + Alert approach would be simplest but you would have to do some work in looking through the strategies to find the correct one.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thanks NinjaTrader_Kate

      Yep, I had surmised as much. As an additional kicker my Strategy makes use of AtmStrategyCreate() for order placement so even within the Strategy level StrategyPerformance is not directly accessible

      Good point regarding the "Generate" button on the Trade Performance UI. That slipped my mind. In a separate thread I had actually asked whether that is accessible as an object to which the reply was that it is not.

      I'll proceed with the MA Column + Alert approach and share the final product in this thread for the benefit of others.

      Thanks again for your help!

      Comment


        #4
        Wanted to close the loop -- I did end up implementing the workaround as characterized; attaching an alert to the Market Analyzer and having that alert re-arm every 15min with the action set to share the Market Analyzer tab.

        I simplified some of the pre-existing Market Analyzer columns and just made use of OnAccountItemUpdate() to fetch my values.

        Click image for larger version  Name:	ntShareServiceAlert.png Views:	0 Size:	68.0 KB ID:	1200450

        Click image for larger version  Name:	ntShareServiceTwitterOutput.png Views:	0 Size:	70.6 KB ID:	1200451

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rocketman7, Today, 09:41 AM
        4 responses
        15 views
        0 likes
        Last Post rocketman7  
        Started by selu72, Today, 02:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by WHICKED, Today, 02:02 PM
        2 responses
        12 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by f.saeidi, Today, 12:14 PM
        8 responses
        21 views
        0 likes
        Last Post f.saeidi  
        Started by Mikey_, 03-23-2024, 05:59 PM
        3 responses
        51 views
        0 likes
        Last Post Sam2515
        by Sam2515
         
        Working...
        X