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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    182 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    334 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    258 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    358 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    187 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X