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

NinjaScript Addons

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

    NinjaScript Addons

    I'm trying to create my own automated journaling system.
    similar to the way shown on this video.
    Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.


    I wish to log a lot more information based on my indicators to help me fine tune my strategies hence why I'm creating my own.


    I have created an add on and added an Action to all my account ExecutionUpdates
    1. How do I tell which ATM was used for the execution.
    2. How do I reference each target to the original order Id.
    3. When I scale in with a new order I need to track the new targets with reference to the scale in OrderId. Is this possible and how do I do it.
    4. I would like to log the last 5 candles from the 5minute data, 15min data and 60min data. How can I access this information from the add on. I have the 5min, 15min,60min and daily charts open if this is of any help.
    5. There is indicator information on the charts I wish to access and log. Is this possible and how do I achieve it.

    I've attached basic sample code for the add on. I've attached Visual studio, but can't seem to find any method to achieve the above

    The reason I used the addon is so it is always loaded and running. However is there a better means to achieve this.

    It seems to hang NT on startup so I have to comment it out prior to starting and then compile it in. Can you see what I've done to cause this.

    Thanks

    Chris
    Attached Files

    #2
    Hello cp.trader,

    Thank you for your post.

    For your first three questions, those would all involve using order.GetOwnerStrategy(). I'm attaching our ATMStrategyIdentifier script that locates ATM strategies on a specified account and instrument and displays the current possible PnL for the stops and targets that should give you some direction there.

    For #4, that would require a BarsRequest:



    For #5, you would either need to calculate those values internally to the addon from the BarsRequest calculation as indicators cannot be called from a bars request, or f you want to venture outside of the supported realm, you could loop through indicators in a chart from the ChartControl.Indicators collection, and access the Values array from each indicator to read their plots. However, this would not have the synchronicity that would get from adding indicators within a host script that offers OnBarUpdate (not a BarsRequest.) You would also have to know which plots of an indicator represent each Value in Values.

    Indicators Collection - https://ninjatrader.com/support/help...indicators.htm

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    22 views
    0 likes
    Last Post trilliantrader  
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    3 views
    0 likes
    Last Post Davidtowleii  
    Started by guillembm, Yesterday, 11:25 AM
    2 responses
    9 views
    0 likes
    Last Post guillembm  
    Started by junkone, 04-21-2024, 07:17 AM
    9 responses
    70 views
    0 likes
    Last Post jeronymite  
    Started by mgco4you, Yesterday, 09:46 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X