Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Diamonds

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

    Diamonds

    Hello, I was just trying to draw a diamond on the chart at this conditon but did not succced, can someone advice please?
    Should I not see some green diamonds here?
    Regards
    Lucci

    protected
    overridevoid Initialize()
    {
    Add(SMA(
    14));
    Add(SMA(
    5));
    CalculateOnBarClose =
    true;
    }
    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    // Condition set 1
    if (SMA(14)[0] > SMA(5)[0])
    {
    DrawDiamond(
    "bigger than" + CurrentBar, false, 0, 0, Color.YellowGreen);

    #2
    This is likely because the diamond is being drawn at 0 on the y-axis and is not autoscaling to display.

    Consider changing the following or something similar:

    DrawDiamond("bigger than" + CurrentBar, false, 0, Low[0] - 2*TickSize, Color.YellowGreen);



    Let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    567 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X