Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

draw arrow based on another drawing object

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

    draw arrow based on another drawing object

    i am trying to have a arrow drawn only if the prior condition was met (which would be a diamond plotted on chart) within 7 bars

    here is the code so far

    if ((EMA(22)[0] >= SMA(89)[0]) //mc is above 89
    && (Low [0]< EMA (22)[0]) //low is below mc
    && (Diff[1] <= 0) //ST macd is below 0
    && (Stochastics(5, 3, 3).K[0] <= 40) //stochs is below 40
    && (LTMACD(5,25,170,25)[0] > 0)) //LT macd above 0
    DrawDiamond(Time[0].ToString(), 0, Low[1] - 3.25* TickSize, Color.Pink);



    if ((Diff[0]>DiffAvg[0] && Diff[1]<DiffAvg[1]) //cross of 1 and 5 sma's [diff(yellow); diffavg(cyan)]
    && (EMA(22)[0] >= SMA(89)[0]) //mc is above 89
    && (Diff[1] <= 0) //ST macd is below 0
    && (Stochastics(5, 3, 3).K[0] <= 40) //stochs is below 40
    && (LTMACD(5,25,170,25)[0] > 0)) //LT macd is above 0
    /// this is where i would like to have a condition of that diamond within the last 7 bars///
    DrawArrowUp(Time[
    0].ToString(), 0, Low[1] - 5.25* TickSize, Color.Lime);
    Last edited by duck_CA; 08-25-2008, 01:59 PM.

    #2
    What's the question?
    RayNinjaTrader Customer Service

    Comment


      #3
      lol... sorry, i'm trying to add the condition where the font is in "orange"

      Comment


        #4
        You could create a variable that stores the "CurrentBar" number of the last time you called DrawDiamond()...

        // Declare a variable outside of OnBarUpdate()...
        private int diamondBarNumber = 0;

        if (condition to draw diamond is true)
        {
        DrawDiamond();
        diamondBarNumber = CurrentBar;
        }

        if (diamonBarNumber != 0 && CurrentBar - diamondBarNumber >= 7)
        DrawArrowUp();
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by kujista, Today, 06:23 AM
        0 responses
        1 view
        0 likes
        Last Post kujista
        by kujista
         
        Started by traderqz, Yesterday, 04:32 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by f.saeidi, Today, 05:56 AM
        1 response
        4 views
        0 likes
        Last Post Jltarrau  
        Started by Jltarrau, Today, 05:57 AM
        0 responses
        4 views
        0 likes
        Last Post Jltarrau  
        Started by Stanfillirenfro, Yesterday, 09:19 AM
        7 responses
        52 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X