• 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

Simple question?

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

    Simple question?

    Hello,

    I have a very simple code which I want to put in a new strategy. But I am a bit at a loss where I should put what?
    Could anyone please point me in the right direction?

    Regards,

    Dennis

    --------------------------
    double result = 0;
    if (High[0] != 0)
    result /= High[0];
    result = Math.Tanh(result);
    result += Close[0];
    result -= Low[0];
    result -= Open[0];
    result = -result;
    result -= Close[0];

    Value.Set(result);


    --------------------------------

    #2
    You'll want to put it in the OnBarUpdate() method.

    Comment


      #3
      Originally posted by Forex99 View Post
      Hello,

      I have a very simple code which I want to put in a new strategy. But I am a bit at a loss where I should put what?
      Could anyone please point me in the right direction?

      Regards,

      Dennis

      --------------------------
      double result = 0;
      if (High[0] != 0)
      result /= High[0];
      result = Math.Tanh(result);
      result += Close[0];
      result -= Low[0];
      result -= Open[0];
      result = -result;
      result -= Close[0];

      Value.Set(result);


      --------------------------------
      There is no Value to set in a Strategy. Put the code in the OnBarUpdate() method in an Indicator.
      Last edited by koganam; 11-20-2014, 10:46 AM. Reason: Corrected spelling.

      Comment


        #4
        Hello Forex99,

        Thank you for your post and welcome to the NinjaTrader Support Forum!

        Please take a look at building an indicator at the following link: http://www.ninjatrader.com/support/h...indicators.htm

        Please let me know if you have any questions.
        Patrick H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by timcjpfx, Today, 01:18 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Tyler  
        Started by lordvader34, Today, 12:48 PM
        2 responses
        12 views
        0 likes
        Last Post lordvader34  
        Started by Newtrader101, Today, 11:06 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Newtrader101, Today, 11:03 AM
        2 responses
        9 views
        0 likes
        Last Post Newtrader101  
        Started by rickyblah12, Today, 09:57 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Working...
        X