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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    157 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    91 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    143 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    130 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    107 views
    0 likes
    Last Post CarlTrading  
    Working...
    X