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

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.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Stanfillirenfro, Today, 07:23 AM
    9 responses
    23 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by George21, Today, 10:07 AM
    0 responses
    8 views
    0 likes
    Last Post George21  
    Started by DayTradingDEMON, Today, 09:28 AM
    2 responses
    19 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by navyguy06, Today, 09:28 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    8 responses
    32 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X