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

Choppy Market Indicator Convert

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

    Choppy Market Indicator Convert

    Can anyone convert this to NT8 - I think it is thinkscript


    declare lower;
    input line = 20;
    def line_new = line/10;

    def UPa =
    if close[1] > close[2] and close[2] > close[3] and close[3] > close[4] and close[4] > close[5] and close[5] > close[6] then yes else no; #Green

    def UPb =
    if close[1] > close[2] and close[2] > close[3] and close[3] > close[4] then yes else no; #Green Slow

    def UPc =
    if close[2] > close[3] and close[3] > close[4] and close[4] > close[5] and close[5] > close[6] then yes else no; #Green Slower

    def UPd = if close[1] > close[2] and close[3] > close[4] and close[4] > close[5] and close[5] > close[6] then yes else no; #Green Slower

    def UPe = if close[1] > close[2] and close[2] > close[3] and close[4] > close[5] and close[5] > close[6] then yes else no; #Green Slower

    def UPf = if close[1] > close[2] and close[2] > close[3] and close[3] > close[4] and close[5] > close[6] then yes else no; #Green Slower

    def UPg = if close[1] > close[2] and close[2] > close[3] and close[3] > close[4] and close[4] > close[5] then yes else no; #Green Slower


    def DNa = if close[1] < close[2] and close[2] < close[3] and close[3] < close[4] and close[4] < close[5] and close[5] < close[6] then yes else no; #Green

    def DNb =
    if close[1] < close[2] and close[2] < close[3] and close[3] < close[4] then yes else no; #Green Slow

    def DNc =
    if close[2] < close[3] and close[3] < close[4] and close[4] < close[5] and close[5] < close[6] then yes else no; #Green Slower

    def DNd =
    if close[1] < close[2] and close[3] < close[4] and close[4] < close[5] and close[5] < close[6] then yes else no; #Green Slower

    def DNe =
    if close[1] < close[2] and close[2] < close[3] and close[4] < close[5] and close[5] < close[6] then yes else no; #Green Slower

    def DNf =
    if close[1] < close[2] and close[2] < close[3] and close[3] < close[4] and close[5] < close[6] then yes else no; #Green Slower

    def DNg =
    if close[1] < close[2] and close[2] < close[3] and close[3] < close[4] and close[4] < close[5] then yes else no; #Green Slower

    def hist =
    if UPa or DNa then
    10
    else
    if UPb or DNb then
    10
    else
    if UPc or UPd or Upe or UPf or UPg or DNc or DNd or DNe or DNf or DNg then
    10
    else
    0;
    #
    def main = hist[1]+hist[2]+hist[3]+hist[4]+hist[5]+hist[6]+hist[7]+hist[8]+hist[9]+hist[10]/10;
    #
    def mainColor = if(main < main[1]) then
    yes
    else
    no;

    plot Choppy = hist*line_new;
    Choppy.SetPaintingStrategy(PaintingStrategy.HISTOG RAM);
    Choppy.SetLineWeight(2);
    Choppy.AssignValueColor(if UPa or DNa then CreateColor(76, 175, 80) else if UPb or DNb then CreateColor(129, 199, 132) else if UPc or UPd or UPe or UPf or UPg or DNc or DNd or UPe or UPf or UPg then CreateColor(200, 230, 201) else color.white); #ColorGreen, ColorGreenSlow, ColorGreenSlower

    plot TheLine = line;
    TheLine.SetLineWeight(2);
    TheLine.AssignValueColor(color.orange);

    plot TheAverage = main;
    TheAverage.SetLineWeight(2);
    TheAverage.AssignValueColor(if mainColor then color.red else CreateColor(170, 76, 175));

    Thanks

    #2
    Hello DTSSTS,

    Thanks for your post.

    It is against our policy in the Support department to create, modify, convert, or debug code for our clients since we are a small team.

    If you would like to convert this script yourself, I suggest opening the NinjaTrader 8 help guide and the Thinkscript documentation side by side so you could compare the Thinkscript documentation to the methods available in the NinjaTrader help guide.

    Below is a link to a forum post with helpful information about getting started with NinjaScript.
    https://ninjatrader.com/support/foru...040#post786040

    This thread will be open for other community members to share their insight or share their conversion.

    Let me know if I may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thanks. I really did not expect Support to convert, but thought possible interest by someone in the community to convert. Thanks for leaving open

      Comment


        #4
        Thats some TOS code i see. GO to Fiver for help

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by dcriador, Today, 01:43 AM
        1 response
        5 views
        0 likes
        Last Post dcriador  
        Started by louiseruch, Today, 01:11 AM
        0 responses
        1 view
        0 likes
        Last Post louiseruch  
        Started by kujista, Today, 12:39 AM
        0 responses
        5 views
        0 likes
        Last Post kujista
        by kujista
         
        Started by tonynt, 05-21-2019, 06:27 AM
        11 responses
        536 views
        1 like
        Last Post NinjaTrader_Jason  
        Started by fitspressotablettry, Today, 12:36 AM
        0 responses
        1 view
        0 likes
        Last Post fitspressotablettry  
        Working...
        X