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

How to do a negative/subtract offset?

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

    How to do a negative/subtract offset?

    Please help! I've been working on this for hours and I'm going crazy!

    I can't code so I'm using the Strategy Wizard. I'm new to NT and so far I've had an easy time setting up the entries and exits I want to test. But I've hit a wall with the Stop Loss. I want my stop loss to be my Entry Price minus ATR(x). (Entry Price doesn't seem to be an option, so the Open Price is an acceptable substitute for now.)

    I found instructions on this forum about setting Variable0 in the conditions and using that in the Stop Loss, but apparently the Wizard will only add not subtract. When I view the code I can see the + and I know that I could change that to a - if I edit the code, but then I wouldn't be able to use the Wizard any more.

    Am I just missing something stupidly obvious? Or did NT overlook this stupidly obvious functionality when they built the Wizard?

    #2
    Hello Diveaholic,

    Thank you for your post and welcome to the forum!

    You are not missing anything. The offset value was designed to add values. You could use a hard value such as -5 which would turn out like this -

    Open[0] + -5 * TickSize

    However, you would not be able to do the same with an Indicator's value. I will forward this to development to consider for the next major release of NinjaTrader

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Lumbeezl, 01-11-2022, 06:50 PM
    30 responses
    803 views
    1 like
    Last Post grayfrog  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    3 responses
    11 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by Johnny Santiago, 10-11-2019, 09:21 AM
    95 responses
    6,193 views
    0 likes
    Last Post xiinteractive  
    Started by Irukandji, Today, 09:34 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by RubenCazorla, Today, 09:07 AM
    1 response
    6 views
    0 likes
    Last Post RubenCazorla  
    Working...
    X