• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using price data at certain indicator time

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

    Using price data at certain indicator time

    If you have a simple strategy say a MA crossovers, how do you snapshot a value at a certain time when an signal happens?

    For example, if I'm using 2 Moving Averages of 50, and 200 for fast and slow respectively, and I want to get long via a limit order when the ask crosses above the 50 BUT at that time, I want to snapshot where the slow moving average is because that's my stop loss. Which methods in code would accomplish this? or how would I do this via the strategy builder?

    Thank those in advance who helps with this question!

    #2
    Hello Boonfly8,

    Thanks for your post and welcome to the NinjaTrader forums!

    In the strategy builder, you can create a (double) variable that you could store the value of the slow moving average at the time that your conditions permit placing the order. In the action section where you place the entry order, you can "set" a user variable (in this case you would set it to the value of the current bar of the 200 period moving average).

    Please see:
    "Understanding the Inputs and Variables screen" in: https://ninjatrader.com/support/help...er_screens.htm

    "How to use user inputs & variables" in: https://ninjatrader.com/support/help...on_builder.htm
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by aligator, Today, 01:49 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by KINGKODA, Today, 12:08 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by zulok, Today, 12:54 PM
    3 responses
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by RadarTradar, 01-04-2020, 10:02 AM
    12 responses
    131 views
    0 likes
    Last Post Eric M.
    by Eric M.
     
    Started by [email protected], Today, 10:54 AM
    3 responses
    20 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Working...
    X