Tradesignal Close Line Indikator

Dieser simple Tradesignal Indikator Code stellt eine waagrechte Linie am aktuellen Close dar. So sehen Sie auf einen Blick wo aktuelle Unterstützungen und Wiederstände liegen.

close line indicator (c)kahler

Fügen Sie den Code per copy&paste als neuen Indikator in Tradeignal ein.

/* Why */
{sample screenshot:}

/* The indicator shows how to work with trendlines.
   It draws a horizontal trendline at the current price. 
   The horizontal line is projected into the past and future.
   This helps when spotting for historic support and resistance levels nearby the current price. */
Meta: 	Synopsis("Displays horizontal line at current price"),
Inputs: ForwardColour(red),
Variables: price, id;

If IsLastBar Then Begin  
  price = close;                       // the price at which the line will be drawn
    If IsLastBar Then begin			 // draw new line on  last bar of chart
      // actually 2 trendlines are drawn. A blue one into the past and a white one into the future
      DrawTrendline(Datetime[1], price, datetime, price, StyleDot, TrendlineSize, BackwardsColour, ToolExtendleft + ToolDrawInForeGround);
      DrawTrendline(Datetime[1], price, datetime, price, StyleDot, TrendlineSize, ForwardColour, ToolExtendRight + ToolDrawInForeGround);
    If BarStatus = BarStatusClosingTick Then Begin // When the current bar is finnished (closingtick) the old trendline is removed.
    While (ToolGetFirst() <> -2)     // The function ToolGetFirst returns -2 if there is no trendline on the chart	
    Begin							 // the following instruction is executed as long as there is a trendline (tool) on he chart
                     // it will not remove any "hand drawn" trendlines, only the ones drawn by this indicator
      ToolDelete(ToolGetFirst())   // If there is one the function ToolDelete will delete this trendline
End; // (c)2007