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

Text on Execution

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

    Text on Execution

    Hello,

    I'm using the language reference to set up text messages via email that are meant to go out whenever the strategy executes a trade (in or out).

    I set up two share services: Email and Text.

    I've included this code into the strategy:

    Code:
    protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
    {
         Share("Text", orderId, new object[]{ "[email protected]", orderId });
    }
    My concern is that the example I used from the reference was for emails rather than email to text.

    Is this how you would do it for email to text? If not, what would be different?

    Edit:
    Including screenshot of an error I am getting in playback
    Attached Files
    Last edited by WalterSkinner; 08-11-2021, 06:20 AM.

    #2
    Hello WalterSkinner,

    Thanks for your post.

    I will assume that you have used the test function on both the share services and have successfully tested both e-mail and e-mail to test. If you haven't please go back to Tools>Options>General and verify both work as expected.

    The construct of the Share() would be the same for email or text.

    I would suggest reducing the Share() down to just the name of the share service and the message you want to share. Based on your example of "
    Share("Text", orderId, new object[]{ "[email protected]", orderId });" I will assume your email to text share service is called Text. An example would be Share("Text", "Your message here");

    Please test with that example and build from there.
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rhyminkevin, Today, 04:58 PM
    3 responses
    47 views
    0 likes
    Last Post Anfedport  
    Started by iceman2018, Today, 05:07 PM
    0 responses
    5 views
    0 likes
    Last Post iceman2018  
    Started by lightsun47, Today, 03:51 PM
    0 responses
    7 views
    0 likes
    Last Post lightsun47  
    Started by 00nevest, Today, 02:27 PM
    1 response
    14 views
    0 likes
    Last Post 00nevest  
    Started by futtrader, 04-21-2024, 01:50 AM
    4 responses
    50 views
    0 likes
    Last Post futtrader  
    Working...
    X