Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Code ATM to manage open positions

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

    Code ATM to manage open positions

    Hi there Ninjas,

    I want automatize my open positions management by coding.

    I usually use an ATM strategy to set a predefined stop loss and take profit when I open a position. Then I manually adjust the stop loss and take profit added for the ATM strategy to a different price according to my own risk-reward ratio for that specific trade

    Let's say I opened a position using a risk:reward 1:5

    When the price reaches 1:2+ I move my stop to 1:2
    When the price reaches 1:3+ I move my stop to 1:3
    When the price reaches 1:4+ I move my stop to 1:4
    I do it until the price reaches my target or touches my stop loss

    By coding my input should be my initial/moved stop loss or stop loss where it is negative acording my entry. Where it should act as a trailing stop then the price reaches 1:2+, 1:3+, etc

    Can someone address to documentation or methods related to an ATM or stop loss?

    Is it posible control/adjust my stop loss when the positions are place manually and not from an automatized strategy ?

    Regards,
    Ale
    Last edited by alejandro888; 06-18-2020, 08:50 PM.

    #2
    Hi alejandro888, thanks for your quesiton.

    In a NinjaScript Strategy, you can submit pre-existing ATM strategy templates. You can not modify orders submitted by a strategy, but you can modify the Stop and Target of the ATM if you use ATMStrategyCreate() in your script.

    https://ninjatrader.com/support/help...strategies.htm - Using ATM strategies through NinjaScript.

    Of course, you don't have to use ATM templates. We have this example that shows how to set up OCO protective orders through code:



    Please let me know if I can assist any further.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    91 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    137 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    121 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    72 views
    0 likes
    Last Post PaulMohn  
    Working...
    X