Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to trade on crossover of line chart

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

    How to trade on crossover of line chart

    hI,
    As we code on NT8 Crossover of Close series against trend indicator ,But how can we generate signals on crossover of line charts with trend line?

    #2
    Hello shankar.deshapande,

    Thanks for your post.

    I have moved this forum thread to the NinjaTrader 8 Strategy Development section of the Forums since it seems you are programming a NinjaScript strategy.

    To clarify, are you wanting to detect if the Close price crosses above/below a trend channel drawing object that you are drawing on the chart?

    A TrendChannel drawing could be drawn on the chart by calling Draw.TrendChannel().

    To detect a drawing object on the chart and get information about that drawing object you could use the DrawObjects collection to either find a draw object by a specific tag name or by looping through the DrawObjects collection to find specific Draw objects.

    Once you get the price of a Draw objects chart anchor, you could use that price for your crossover conditions.

    See the help guide documentation below for more information and sample code.

    Draw.TrendChannel(): https://ninjatrader.com/support/help...b=trendchannel
    DrawObjects collection: https://ninjatrader.com/support/help...sub=drawobject
    IDrawingTool values: https://ninjatrader.com/support/help...rawingtool.htm


    If you are referring to using the SuperTrend indicator for crossovers, you could use the plot of the SuperTrend indicator to detect if the Close price crosses above/below the plot value of the SuperTrend indicator. This is similar to detecting if the Close price crosses above/below the SMA indicator plot in the SampleMACrossover script.

    To view the SampleMACrossover strategy, open a New > NinjaScript Editor window, open the Strategies folder, and double-click the SampleMACrossover file.

    CrossAbove(): https://ninjatrader.com/support/help...crossabove.htm
    CrossBelow(): https://ninjatrader.com/support/help...crossbelow.htm
    Last edited by NinjaTrader_BrandonH; 08-20-2023, 02:27 PM.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X