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 NullPointStrategies, Today, 05:17 AM
    0 responses
    50 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X