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

Converting from prorealtime.com

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

    Converting from prorealtime.com

    Hi there

    I wrote some code for the software that prorealtime.com uses (and IG Index), but I'm baffled by Ninja traders code.

    I was wondering if someone could help me convert the following code so I can better learn exactly where the differnces are?

    Before I go on, http://www.ninjatrader-support.com/H...sAndConditions talks about automatically inserting actions and conditions, but when I right click, the insert action/ condition option isn't there. Am I missing something?

    Here's the code I need converting in the original format:

    KC refers to the respective Keltner channels
    Bollingerup is the upper bollinger band.

    It's a simple binary indicator.
    The second is an average of the momentum oscilator
    You probably won't need the first couple of lines. They were needed because Prorealtime didnt have a Keltner channel indicator built in.

    The Squeeze

    UpperKC = average [20](close) + 1.5*averagetruerange[20](close)
    LowerKC = average [20](close) - 1.5*averagetruerange[20](close)

    condition1 = BollingerUp[20](close) < UpperKC
    condition2 = bollingerdown[20](close) > LowerKC

    IF Condition1 then

    a=1
    elsif condition2 then

    a=1

    else
    a=0
    endif
    return a coloured(0,0,225)

    The Momentum Oscilator

    RETURN exponentialAverage[5](Momentum[12](close))

    I hope someone can help. I find prorealtime to be quite logical and am hoping someone can help me by converting. I learn best this way, so sorry if it appears I'm being lazy.

    Thank you for your help

    Dave

    #2
    Dave, please try pressing F2 in your NinjaScript editor to be able to access the 'Insert Snippet' function.

    Before attempting to convert custom code, it might be helpful to review those tutorials we have created for a smooth start in NinjaScript -



    An SMA of Period 20 using default close prices as input would be this -

    Code:
     
    double value = SMA(20)[0];
    Last edited by NinjaTrader_Bertrand; 03-12-2012, 01:51 AM.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hello Bertrand,

      I was as well looking into converting codes/indicators from the Pro Real Time platform onto Ninja Trader 7, with no success so far, If anyone can help it would be greatly appreciated. Thanks in advance.
      P.S the link you posted -http://www.ninjatrader-support.com/H...verview18.html- does not open to anything helpful but to some search page instead.

      Nico.

      Comment


        #4
        Thanks, that's an outdated link by now, from times before our website rework - for getting started in our NinjaScript, please use those tutorials here - http://www.ninjatrader.com/support/h.../tutorials.htm
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Skifree, Today, 03:41 AM
        1 response
        2 views
        0 likes
        Last Post Skifree
        by Skifree
         
        Started by usazencort, Today, 01:16 AM
        0 responses
        1 view
        0 likes
        Last Post usazencort  
        Started by kaywai, 09-01-2023, 08:44 PM
        5 responses
        603 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by xiinteractive, 04-09-2024, 08:08 AM
        6 responses
        23 views
        0 likes
        Last Post xiinteractive  
        Started by Pattontje, Yesterday, 02:10 PM
        2 responses
        23 views
        0 likes
        Last Post Pattontje  
        Working...
        X