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 GLFX005, Today, 03:23 AM
        0 responses
        0 views
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        11 views
        0 likes
        Last Post XXtrader  
        Started by Waxavi, Today, 02:10 AM
        0 responses
        6 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        11 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Working...
        X