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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    78 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X