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

Starter Coding Indicator Help

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

    Starter Coding Indicator Help

    Hi!

    I thought for my first indicator I'd do something simple like connecting similar candlesticks with an extended line or ray (what's the diff?). I'm getting there but still having problems.


    - I need to have the ray draw only when the currentbar is open=close
    - The code doesn't like my (Math.Abs(High(0) == Close(0)) anywhere I put it

    - There's something wrong in the calculation of the barsago I think

    Anyway, any help is appreciated
    Last edited by stockgoblin; 07-20-2011, 03:42 PM.

    #2
    stockgoblin,

    Thanks for the post. Extended lines extend in both directions, a ray only one direction. To connect two points, a line seems more appropriate than either of these.

    Generally we don't offer code debugging but I gave your script a quick run here. I see a line drawn on the chart, so it's doing something. May need to refine the statements for what you're going for. First place I'd look is your EndBarsAgo for your line. You have it set to CurrentBar, which means it's drawing that point always at the first bar in the series.

    - The code doesn't like my (Math.Abs(Open(0) == Close(0)) anywhere I put it
    You need brackets (not parentheses) for bar indexes, like used in other places in your code.

    For debugging in NinjaScript, use plenty of Print() statements to check all values. Since each historical OnBarUpdate() belongs with a specific bar, include CurrentBar to track values along with their bar index. Additional help for debugging is available here:
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by traderqz, Today, 12:06 AM
    10 responses
    18 views
    0 likes
    Last Post traderqz  
    Started by algospoke, 04-17-2024, 06:40 PM
    5 responses
    46 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by arvidvanstaey, Today, 02:19 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by mmckinnm, Today, 01:34 PM
    3 responses
    5 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by f.saeidi, Today, 01:32 PM
    2 responses
    9 views
    0 likes
    Last Post f.saeidi  
    Working...
    X