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

Account Protection Add-on

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

    Account Protection Add-on

    Hi NT Team,

    Quick question - I find myself displaying all kinds of undesirable behavior patterns when trading. Am wondering if there is a way to intercept trading activity and either suppress or redirect such activity. The idea would be: Let's have a permanently running addon which allows you to somehow specify non-trading conditions. If the conditions are met the addon either:
    • intercepts buy/sell button clicks and cancels them (saw that you can add your own click event, just unsure if you can cancel the click...) or
    • redirects all trades into Sim101 or
    • enforces global simulation mode or
    • adds an invisible object over the chart trader effectively preventing clicks on the buttons or
    • ...
    Conditions I might monitor for:
    • Trade frequency (# of trades < max trades per day/hour/min)
    • Max daily loss hit
    • Position size too large
    • etc.
    Any thoughts / pointers on how to go about this would be appreciated.

    Kind regards
    Frank

    #2
    Hello Adfra,

    Thanks four your post.

    We would not want to provide much direction here as we would not want scripts to be silently preventing expected behaviors of the platform from operating. This could create a support nightmare if users are running a third party script that takes actions to intercept orders and the user is not fully aware.

    If you are trying to do this for your own purposes, you can look into account OrderUpdate events to see each order as it gets created and processed in the platform and try to take action there. This would not be supported.

    OrderUpdate - https://ninjatrader.com/support/help...rderupdate.htm

    Trade frequency could be counted by monitoring executions, but you would have to pair these together to identify trades. You could also consider looking at the account PositionUpdate event to see when positions are opened and closed.

    ExecutionUpdate - https://ninjatrader.com/support/help...tionupdate.htm

    PositionUpdate - https://ninjatrader.com/support/help...tionupdate.htm

    Account.Get can be used to see daily account values if you would like to check account Realized/UnRealized PnL. Note that your broker will need to offer these values. Please see the Accounts tab documentation to verify which AccoutItems are available with your connection technology.

    Account.Get - https://ninjatrader.com/support/helpGuides/nt8/get.htm

    Accounts tab - https://ninjatrader.com/support/help...TheAccountsTab

    We look forward to assisting.
    Attached Files
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ScottWalsh, Today, 06:52 PM
    0 responses
    0 views
    0 likes
    Last Post ScottWalsh  
    Started by ftsc2022, 10-25-2022, 12:03 PM
    5 responses
    255 views
    0 likes
    Last Post KeyonMatthews  
    Started by ScottW, Today, 06:09 PM
    0 responses
    3 views
    0 likes
    Last Post ScottW
    by ScottW
     
    Started by Board game geek, 10-29-2023, 12:00 PM
    14 responses
    244 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Waxavi, 04-19-2024, 02:10 AM
    4 responses
    56 views
    0 likes
    Last Post sonia0101  
    Working...
    X