• 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

SMA displacement

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

    SMA displacement

    I see you can set a displacement on a simple moving average on a chart, but you cannot set a displacement value on an SMA in an automated strategy. IS this true ?
    Is there a reason for this ?

    Thank you for your help

    shane

    #2
    Originally posted by shanemcdonald View Post
    I see you can set a displacement on a simple moving average on a chart, but you cannot set a displacement value on an SMA in an automated strategy. IS this true ?
    Is there a reason for this ?

    Thank you for your help

    shane
    Not true: you use the indexing capability.
    Code:
    double displacedSMAValue  = SMA(Close, Period)[displaceValue];
    Alternatively, use a named instance, and set the Displacement property.
    Code:
    private SMA displacedSMA;
    private int displacementValue = 10; //(say)
    private int Period = 10; //(say)
    Code:
    displacedSMA = SMA(Close, Period);
    displacedSMA.Displacement = displacementValue;

    Comment


      #3
      Hi

      Thank you very much for that info !
      That was good of you.

      shane

      Comment


        #4
        Hello Shane,

        Thank you for your post and Koganam for answering.

        Let us know if we can be of further assistance.
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by faustf, Today, 05:00 AM
        0 responses
        5 views
        0 likes
        Last Post faustf
        by faustf
         
        Started by NinjaCustomer, Today, 03:19 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by MarianApalaghiei, Today, 02:54 AM
        1 response
        5 views
        0 likes
        Last Post MarianApalaghiei  
        Started by RandanAL, Yesterday, 11:58 PM
        0 responses
        5 views
        0 likes
        Last Post RandanAL  
        Started by Kabua, Yesterday, 11:24 PM
        0 responses
        5 views
        0 likes
        Last Post Kabua
        by Kabua
         
        Working...
        X