1. 首页
  2. 易语言 - EasyLanguage
  3. 用EasyLanguage画斐波纳契回溯线 Drawing Fibonacci Retracement Lines from EasyLanguage

用EasyLanguage画斐波纳契回溯线 Drawing Fibonacci Retracement Lines from EasyLanguage

Example 1
Basic example of Fibonacci retracement lines based on the day’s highs and lows, for these values: 0%, 100%, 61.8%, 50%, and 38.2%.

inputs: 
	ExtendLinesRight( false ), 
	ExtendLinesLeft( false ), 
	Style_0_100( Tool_Solid ), 
	Color_0_100( Magenta ), 
	Style_Fibs( Tool_Dashed ), 
	Color_Fibs( Cyan ) ;  
 
variables: 
	TLID_0( 0 ), 
	TLID_100( 0 ), 
	TLID_50( 0 ), 
	TLID_618( 0 ), 
	TLID_382( 0 ), 
	LowOfDay( 0 ), 
	HighOfDay( 0 ), 
	Fib_50( 0 ), 
	Fib_618( 0 ), 
	Fib_382( 0 ), 
	TL_StartTime( 0 ), 
	TL_StartDate( 0 ) ; 
 
// Create TLs one time 
Once 
	begin 
	TLID_0 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_0, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_0, true ) ; 
	TL_SetStyle( TLID_0, Style_0_100 ) ; 
	TL_SetColor( TLID_0, Color_0_100 ) ; 
	 
	TLID_100 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_100, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_100, true ) ; 
	TL_SetStyle( TLID_100, Style_0_100 ) ; 
	TL_SetColor( TLID_100, Color_0_100 ) ; 
	 
	TLID_50 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_50, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_50, true ) ; 
	TL_SetStyle( TLID_50, Style_Fibs ) ; 
	TL_SetColor( TLID_50, Color_Fibs ) ; 
	 
	TLID_618 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_618, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_618, true ) ; 
	TL_SetStyle( TLID_618, Style_Fibs ) ; 
	TL_SetColor( TLID_618, Color_Fibs ) ; 
	 
	TLID_382 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_382, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_382, true ) ; 
	TL_SetStyle( TLID_382, Style_Fibs ) ; 
	TL_SetColor( TLID_382, Color_Fibs ) ; 
	end ; 
 
//Track Hi/Lo of the day 
if Date <> Date[1] then 
	begin 
	HighOfDay = High ; 
	LowOfDay = Low ; 
	TL_StartTime = Time ; 
	TL_StartDate = Date ; 
	end 
else 
	begin 
	if High > HighOfDay then HighOfDay = High ; 
	if Low < LowOfDay then LowOfDay = Low ; 
	end ; 
 
//Calc fib levels 
Fib_382 = ( HighOfDay - LowOfDay ) * .382  + LowOfDay ; 
Fib_50 = ( HighOfDay + LowOfDay ) * .5 ; 
Fib_618 = ( HighOfDay - LowOfDay ) * .618 + LowOfDay ; 
 
//Adjust trend lines 
if TLID_0 > 0 then 
	begin 
	TL_SetBegin( TLID_0, TL_StartDate, TL_StartTime, LowOfDay ) ; 
	TL_SetEnd( TLID_0, Date, Time, LowOfDay ) ; 
	end ; 
 
if TLID_100 > 0 then 
	begin 
	TL_SetBegin( TLID_100, TL_StartDate, TL_StartTime, HighOfDay ) ; 
	TL_SetEnd( TLID_100, Date, Time, HighOfDay ) ; 
	end ; 
 
if TLID_382 > 0 then 
	begin 
	TL_SetBegin( TLID_382, TL_StartDate, TL_StartTime, Fib_382 ) ; 
	TL_SetEnd( TLID_382, Date, Time, Fib_382 ) ; 
	end ; 
 
if TLID_50 > 0 then 
	begin 
	TL_SetBegin( TLID_50, TL_StartDate, TL_StartTime, Fib_50 ) ; 
	TL_SetEnd( TLID_50, Date, Time, Fib_50 ) ; 
	end ; 
	 
if TLID_618 > 0 then 
	begin 
	TL_SetBegin( TLID_618, TL_StartDate, TL_StartTime, Fib_618 ) ; 
	TL_SetEnd( TLID_618, Date, Time, Fib_618 ) ; 
	end ;	 

Example 2
Extension of basic example, with additional levels.

Example 2
inputs: 
	ExtendLinesRight( false ), 
	ExtendLinesLeft( false ), 
	Style_0_100( Tool_Solid ), 
	Color_0_100( Magenta ), 
	Style_Fibs( Tool_Dashed ), 
	Color_Fibs( Cyan ) ;  
 
variables: 
	TLID_0( 0 ), 
	TLID_100( 0 ), 
	TLID_50( 0 ), 
	TLID_618( 0 ), 
	TLID_382( 0 ), 
	TLID_236( 0 ), 
	TLID_764( 0 ), 
	TLID_N618( 0 ), 
	TLID_P618( 0 ), 
	LowOfDay( 0 ), 
	HighOfDay( 0 ), 
	HiLoDiff( 0 ), 
	Fib_50( 0 ), 
	Fib_618( 0 ), 
	Fib_382( 0 ), 
	Fib_236( 0 ), 
	Fib_764( 0 ), 
	Fib_N618( 0 ), 
	Fib_P618( 0 ), 
	TL_StartTime( 0 ), 
	TL_StartDate( 0 ) ; 
 
// Create TLs one time 
Once 
	begin 
	 
	TLID_0 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_0, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_0, true ) ; 
	TL_SetStyle( TLID_0, Style_0_100 ) ; 
	TL_SetColor( TLID_0, Color_0_100 ) ; 
	 
	TLID_100 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_100, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_100, true ) ; 
	TL_SetStyle( TLID_100, Style_0_100 ) ; 
	TL_SetColor( TLID_100, Color_0_100 ) ; 
	 
	TLID_50 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_50, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_50, true ) ; 
	TL_SetStyle( TLID_50, Style_Fibs ) ; 
	TL_SetColor( TLID_50, Color_Fibs ) ; 
	 
	TLID_618 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_618, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_618, true ) ; 
	TL_SetStyle( TLID_618, Style_Fibs ) ; 
	TL_SetColor( TLID_618, Color_Fibs ) ; 
	 
	TLID_382 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_382, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_382, true ) ; 
	TL_SetStyle( TLID_382, Style_Fibs ) ; 
	TL_SetColor( TLID_382, Color_Fibs ) ; 
	 
	TLID_236 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_236, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_236, true ) ; 
	TL_SetStyle( TLID_236, Style_Fibs ) ; 
	TL_SetColor( TLID_236, Color_Fibs ) ; 
	 
	TLID_764 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_764, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_764, true ) ; 
	TL_SetStyle( TLID_764, Style_Fibs ) ; 
	TL_SetColor( TLID_764, Color_Fibs ) ; 
	 
	TLID_N618 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_N618, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_N618, true ) ; 
	TL_SetStyle( TLID_N618, Style_Fibs ) ; 
	TL_SetColor( TLID_N618, Color_Fibs ) ; 
	 
	TLID_P618 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_P618, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_P618, true ) ; 
	TL_SetStyle( TLID_P618, Style_Fibs ) ; 
	TL_SetColor( TLID_P618, Color_Fibs ) ; 
		 
	end ; 
 
//Track Hi/Lo of the day 
if Date <> Date[1] then 
	begin 
	HighOfDay = High ; 
	LowOfDay = Low ; 
	TL_StartTime = Time ; 
	TL_StartDate = Date ; 
	end 
else 
	begin 
	if High > HighOfDay then HighOfDay = High ; 
	if Low < LowOfDay then LowOfDay = Low ; 
	end ; 
 
//Calc fib levels 
HiLoDiff = HighOfDay - LowOfDay ; 
Fib_236 = HiLoDiff * .236  + LowOfDay ; 
Fib_382 = HiLoDiff * .382  + LowOfDay ; 
Fib_50 = HiLoDiff * .5 + LowOfDay ; 
Fib_618 = HiLoDiff * .618 + LowOfDay ; 
Fib_764 = HiLoDiff * .764 + LowOfDay ; 
Fib_N618 = LowOfDay - HiLoDiff * .618 ;  
Fib_P618 = HighOfDay + HiLoDiff * .618 ;  
 
//Adjust trend lines 
if TLID_0 > 0 then 
	begin 
	TL_SetBegin( TLID_0, TL_StartDate, TL_StartTime, LowOfDay ) ; 
	TL_SetEnd( TLID_0, Date, Time, LowOfDay ) ; 
	end ; 
 
if TLID_100 > 0 then 
	begin 
	TL_SetBegin( TLID_100, TL_StartDate, TL_StartTime, HighOfDay ) ; 
	TL_SetEnd( TLID_100, Date, Time, HighOfDay ) ; 
	end ; 
 
if TLID_382 > 0 then 
	begin 
	TL_SetBegin( TLID_382, TL_StartDate, TL_StartTime, Fib_382 ) ; 
	TL_SetEnd( TLID_382, Date, Time, Fib_382 ) ; 
	end ; 
 
if TLID_50 > 0 then 
	begin 
	TL_SetBegin( TLID_50, TL_StartDate, TL_StartTime, Fib_50 ) ; 
	TL_SetEnd( TLID_50, Date, Time, Fib_50 ) ; 
	end ; 
	 
if TLID_618 > 0 then 
	begin 
	TL_SetBegin( TLID_618, TL_StartDate, TL_StartTime, Fib_618 ) ; 
	TL_SetEnd( TLID_618, Date, Time, Fib_618 ) ; 
	end ;	 
	 
if TLID_236 > 0 then 
	begin 
	TL_SetBegin( TLID_236, TL_StartDate, TL_StartTime, Fib_236 ) ; 
	TL_SetEnd( TLID_236, Date, Time, Fib_236 ) ; 
	end ; 
	 
if TLID_764 > 0 then 
	begin 
	TL_SetBegin( TLID_764, TL_StartDate, TL_StartTime, Fib_764 ) ; 
	TL_SetEnd( TLID_764, Date, Time, Fib_764 ) ; 
	end ;		 
	 
if TLID_N618 > 0 then 
	begin 
	TL_SetBegin( TLID_N618, TL_StartDate, TL_StartTime, Fib_N618 ) ; 
	TL_SetEnd( TLID_N618, Date, Time, Fib_N618 ) ; 
	end ; 
	 
if TLID_P618 > 0 then 
	begin 
	TL_SetBegin( TLID_P618, TL_StartDate, TL_StartTime, Fib_P618 ) ; 
	TL_SetEnd( TLID_P618, Date, Time, Fib_P618 ) ; 
	end ;		 

Example 3
An example of how to calculate and plot the fib trendlines based on the high / low of the entire chart. You may need to modify the code further to meet your exact needs. For instance, you may want to try adding additional levels.

Example 3
inputs: 
	UseHighLow( true ), 
	ExtendLinesRight( true ), 
	ExtendLinesLeft( true ), 
	Style_0_100( Tool_Solid ), 
	Color_0_100( Magenta ), 
	Style_Fibs( Tool_Dashed ), 
	Color_Fibs( Cyan ) ;  
 
variables: 
	TLID_0( 0 ), 
	TLID_100( 0 ), 
	TLID_50( 0 ), 
	TLID_618( 0 ), 
	TLID_382( 0 ), 
	TLID_236( 0 ), 
	TLID_764( 0 ), 
	LowOfDay( 0 ), 
	HighOfDay( 0 ), 
	HiLoDiff( 0 ), 
	Fib_50( 0 ), 
	Fib_618( 0 ), 
	Fib_382( 0 ), 
	Fib_236( 0 ), 
	Fib_764( 0 ) ; 
	 
 
// Create TLs one time 
if CurrentBar = 1 then 
	begin 
	 
	if UseHighLow then 
		begin 
		HighofDay = High ; 
		LowofDay = Low ; 
		end 
	else 
		begin 
		HighofDay = MaxList( Open, Close ) ; 
		LowofDay = MinList( Open, Close ) ; 
		end ; 
	 
	TLID_0 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_0, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_0, true ) ; 
	TL_SetStyle( TLID_0, Style_0_100 ) ; 
	TL_SetColor( TLID_0, Color_0_100 ) ; 
	 
	TLID_100 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_100, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_100, true ) ; 
	TL_SetStyle( TLID_100, Style_0_100 ) ; 
	TL_SetColor( TLID_100, Color_0_100 ) ; 
	 
	TLID_50 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_50, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_50, true ) ; 
	TL_SetStyle( TLID_50, Style_Fibs ) ; 
	TL_SetColor( TLID_50, Color_Fibs ) ; 
	 
	TLID_618 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_618, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_618, true ) ; 
	TL_SetStyle( TLID_618, Style_Fibs ) ; 
	TL_SetColor( TLID_618, Color_Fibs ) ; 
	 
	TLID_382 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_382, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_382, true ) ; 
	TL_SetStyle( TLID_382, Style_Fibs ) ; 
	TL_SetColor( TLID_382, Color_Fibs ) ; 
	 
	TLID_236 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_236, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_236, true ) ; 
	TL_SetStyle( TLID_236, Style_Fibs ) ; 
	TL_SetColor( TLID_236, Color_Fibs ) ; 
	 
	TLID_764 = TL_New( Date, Time, Open, Date, Time, Open ) ;	 
	if ExtendLinesRight then TL_SetExtRight( TLID_764, true ) ; 
	if ExtendLinesLeft then TL_SetExtLeft( TLID_764, true ) ; 
	TL_SetStyle( TLID_764, Style_Fibs ) ; 
	TL_SetColor( TLID_764, Color_Fibs ) ; 
	end  
else 
	begin 
	if UseHighLow then 
		begin 
		if High > HighOfDay then HighOfDay = High ; 
		if Low < LowOfDay then LowOfDay = Low ; 
		end 
	else 
		begin 
		if MaxList( Open, Close ) > HighofDay then HighofDay = MaxList( Open, Close ) ; 
		if MinList( Open, Close ) < LowofDay then LowofDay = MinList( Open, Close ) ; 
		end ; 
	end ; 
 
//Calc fib levels 
HiLoDiff = HighOfDay - LowOfDay ; 
Fib_236 = HiLoDiff * .236  + LowOfDay ; 
Fib_382 = HiLoDiff * .382  + LowOfDay ; 
Fib_50 = HiLoDiff * .5 + LowOfDay ; 
Fib_618 = HiLoDiff * .618 + LowOfDay ; 
Fib_764 = HiLoDiff * .764 + LowOfDay ; 
 
//Adjust trend lines 
if TLID_0 > 0 then 
	begin 
	TL_SetBegin( TLID_0, Date, Time, LowOfDay ) ; 
	TL_SetEnd( TLID_0, Date, Time, LowOfDay ) ; 
	end ; 
 
if TLID_100 > 0 then 
	begin 
	TL_SetBegin( TLID_100, Date, Time, HighOfDay ) ; 
	TL_SetEnd( TLID_100, Date, Time, HighOfDay ) ; 
	end ; 
 
if TLID_382 > 0 then 
	begin 
	TL_SetBegin( TLID_382, Date, Time, Fib_382 ) ; 
	TL_SetEnd( TLID_382, Date, Time, Fib_382 ) ; 
	end ; 
 
if TLID_50 > 0 then 
	begin 
	TL_SetBegin( TLID_50, Date, Time, Fib_50 ) ; 
	TL_SetEnd( TLID_50, Date, Time, Fib_50 ) ; 
	end ; 
	 
if TLID_618 > 0 then 
	begin 
	TL_SetBegin( TLID_618, Date, Time, Fib_618 ) ; 
	TL_SetEnd( TLID_618, Date, Time, Fib_618 ) ; 
	end ;	 
	 
if TLID_236 > 0 then 
	begin 
	TL_SetBegin( TLID_236, Date, Time, Fib_236 ) ; 
	TL_SetEnd( TLID_236, Date, Time, Fib_236 ) ; 
	end ; 
	 
if TLID_764 > 0 then 
	begin 
	TL_SetBegin( TLID_764, Date, Time, Fib_764 ) ; 
	TL_SetEnd( TLID_764, Date, Time, Fib_764 ) ; 
	end ;		 
	 

Example 4
Updated the code to: 

  • Provide labels showing the price levels and fib percent
  • Provide for the ability to set an alert at a cross of ANY level, not just a fib level. The alerts create the ability to scan in RadarScreen or Scanner
  • Show the alert level in a different color
  • Provide a choice of when to begin calculation – Beginning of day or beginning of session
inputs:  
	ExtendLinesRight( false ),  
	ExtendLinesLeft( false ),  
	Style_0_100( Tool_Solid ),  
	Color_0_100( Magenta ),  
	Style_Fibs( Tool_Dashed ),  
	Color_Fibs( Cyan ), 
	Color_Alert( Green ), 
	ShowLabels( false ), 
	LabelsLeft( false ), 
	AlertLevel( 23.6 ), 
	ShowAlertTL( false ), 
	UseSessionOrDateChange_0_or_1( 0 ) ;   
  
variables:  
	TLID_0( 0 ),  
	TLID_100( 0 ),  
	TLID_50( 0 ),  
	TLID_618( 0 ),  
	TLID_382( 0 ),  
	TLID_236( 0 ),  
	TLID_764( 0 ),  
	TextID_0( 0 ),  
	TextID_100( 0 ),  
	TextID_50( 0 ),  
	TextID_618( 0 ),  
	TextID_382( 0 ),  
	TextID_236( 0 ),  
	TextID_764( 0 ),  
	TLID_Alert( 0 ), 
	TextID_Alert( 0 ), 
	LowOfDay( 0 ),  
	HighOfDay( 0 ),  
	HiLoDiff( 0 ),  
	Fib_50( 0 ),  
	Fib_618( 0 ),  
	Fib_382( 0 ),  
	Fib_236( 0 ),  
	Fib_764( 0 ),  
 	Alert_Price( 0 ), 
	TL_StartTime( 0 ),  
	TL_StartDate( 0 ), 
	NumDecimals( 0 ), 
	AlertLevelTxt( NumToStr( AlertLevel, 1 ) ), 
	CurrSess( 0 ), 
	CalcTrigger( false ), 
	LabelAlign( iff( LabelsLeft, 1, 0 ) ) ;  
  
// Create TLs / Labels / Calc Decimal Places one time  
Once  
	begin  
	if Category = 12 then  
		NumDecimals = Log( PriceScale ) / Log( 10 ) - 1  
	else  
		NumDecimals = Log( PriceScale ) / Log( 10 ) ;   
	  
	  
	  
	TLID_0 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_0, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_0, true ) ;  
	TL_SetStyle( TLID_0, Style_0_100 ) ;  
	TL_SetColor( TLID_0, Color_0_100 ) ;  
	  
	TLID_100 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_100, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_100, true ) ;  
	TL_SetStyle( TLID_100, Style_0_100 ) ;  
	TL_SetColor( TLID_100, Color_0_100 ) ;  
	  
	TLID_50 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_50, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_50, true ) ;  
	TL_SetStyle( TLID_50, Style_Fibs ) ;  
	TL_SetColor( TLID_50, Color_Fibs ) ;  
	  
	TLID_618 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_618, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_618, true ) ;  
	TL_SetStyle( TLID_618, Style_Fibs ) ;  
	TL_SetColor( TLID_618, Color_Fibs ) ;  
	  
	TLID_382 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_382, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_382, true ) ;  
	TL_SetStyle( TLID_382, Style_Fibs ) ;  
	TL_SetColor( TLID_382, Color_Fibs ) ;  
	  
	TLID_236 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_236, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_236, true ) ;  
	TL_SetStyle( TLID_236, Style_Fibs ) ;  
	TL_SetColor( TLID_236, Color_Fibs ) ;  
	  
	TLID_764 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_764, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_764, true ) ;  
	TL_SetStyle( TLID_764, Style_Fibs ) ;  
	TL_SetColor( TLID_764, Color_Fibs ) ;  
	  
	if ShowAlertTL then 
		begin  
		TLID_Alert = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
		if ExtendLinesRight then TL_SetExtRight( TLID_Alert, true ) ;  
		if ExtendLinesLeft then TL_SetExtLeft( TLID_Alert, true ) ;  
		TL_SetStyle( TLID_Alert, Style_Fibs ) ;  
		TL_SetColor( TLID_Alert, Color_Alert ) ; 
		end ; 
	 
	if ShowLabels then 
		begin 
		TextID_0 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_0, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_0, Color_0_100 ) ; 
			 
		TextID_100 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_100, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_100, Color_0_100 ) ; 
		 
		TextID_50 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_50, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_50, Color_Fibs ) ; 
			 
		TextID_618 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_618, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_618, Color_Fibs ) ; 
			 
		TextID_382 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_382, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_382, Color_Fibs ) ; 
			 
		TextID_236 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_236, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_236, Color_Fibs ) ; 
		 
		TextID_764 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_764, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_764, Color_Fibs ) ; 
		 
		if ShowAlertTL then 
			begin 
			TextID_Alert = Text_New( Date, Time, Close, " " ) ; 
			Text_SetStyle( TextID_Alert, LabelAlign, 1 ) ; ;  
			Text_SetColor( TextID_Alert, Color_Alert ) ; 
			end ;  
		end ;	 
	end ;  
  
//Track Hi/Lo of the day/Session  
 
CurrSess = CurrentSession( 0 ) ; 
CalcTrigger = iffLogic( UseSessionOrDateChange_0_or_1 = 0, CurrSess <> CurrSess[1], 
 Date <> Date[1] ) ; 
 
if CalcTrigger then  
	begin  
	HighOfDay = High ;  
	LowOfDay = Low ;  
	TL_StartTime = Time ;  
	TL_StartDate = Date ;  
	end  
else  
	begin  
	if High > HighOfDay then HighOfDay = High ;  
	if Low < LowOfDay then LowOfDay = Low ;  
	end ;  
  
//Calc fib levels  
HiLoDiff = HighOfDay - LowOfDay ;  
Fib_236 = HiLoDiff * .236  + LowOfDay ;  
Fib_382 = HiLoDiff * .382  + LowOfDay ;  
Fib_50 = HiLoDiff * .5 + LowOfDay ;  
Fib_618 = HiLoDiff * .618 + LowOfDay ;  
Fib_764 = HiLoDiff * .764 + LowOfDay ;  
Alert_Price =  HiLoDiff * AlertLevel * .01 + LowOfDay ; 
  
//Adjust trend lines  
if TLID_0 > 0 then  
	begin  
	TL_SetBegin( TLID_0, TL_StartDate, TL_StartTime, LowOfDay ) ;  
	TL_SetEnd( TLID_0, Date, Time, LowOfDay ) ;  
	end ;  
  
if TLID_100 > 0 then  
	begin  
	TL_SetBegin( TLID_100, TL_StartDate, TL_StartTime, HighOfDay ) ;  
	TL_SetEnd( TLID_100, Date, Time, HighOfDay ) ;  
	end ;  
  
if TLID_382 > 0 then  
	begin  
	TL_SetBegin( TLID_382, TL_StartDate, TL_StartTime, Fib_382 ) ;  
	TL_SetEnd( TLID_382, Date, Time, Fib_382 ) ;  
	end ;  
  
if TLID_50 > 0 then  
	begin  
	TL_SetBegin( TLID_50, TL_StartDate, TL_StartTime, Fib_50 ) ;  
	TL_SetEnd( TLID_50, Date, Time, Fib_50 ) ;  
	end ;  
	  
if TLID_618 > 0 then  
	begin  
	TL_SetBegin( TLID_618, TL_StartDate, TL_StartTime, Fib_618 ) ;  
	TL_SetEnd( TLID_618, Date, Time, Fib_618 ) ;  
	end ;	  
	  
if TLID_236 > 0 then  
	begin  
	TL_SetBegin( TLID_236, TL_StartDate, TL_StartTime, Fib_236 ) ;  
	TL_SetEnd( TLID_236, Date, Time, Fib_236 ) ;  
	end ;  
	  
if TLID_764 > 0 then  
	begin  
	TL_SetBegin( TLID_764, TL_StartDate, TL_StartTime, Fib_764 ) ;  
	TL_SetEnd( TLID_764, Date, Time, Fib_764 ) ;  
	end ;		  
	  
if TLID_Alert > 0 then 
	begin  
	TL_SetBegin( TLID_Alert, TL_StartDate, TL_StartTime, Alert_Price ) ;  
	TL_SetEnd( TLID_Alert, Date, Time, Alert_Price ) ;  
	end ; 
	 
 
// Update labels 
if ShowLabels then 
	begin 
		if TextID_0 > 0 then 
			begin 
			Text_SetString( TextID_0, NumtoStr( LowOfDay, NumDecimals ) + " - 00.0%" ) ;  
			Text_SetLocation( TextID_0, Date, Time, LowOfDay ) ; 
			end ; 
			 
		if TextID_100 > 0 then 
			begin 
			Text_SetString( TextID_100, NumtoStr( HighOfDay, NumDecimals ) + " - 100.0%") ;  
			Text_SetLocation( TextID_100, Date, Time, HighOfDay ) ; 
			end ; 
		 
		if TextID_382 > 0 then 
			begin 
			Text_SetString( TextID_382, NumtoStr( Fib_382, NumDecimals ) + " - 38.2%" ) ;  
			Text_SetLocation( TextID_382, Date, Time, Fib_382 ) ; 
			end ; 
	 
		if TextID_50 > 0 then 
			begin 
			Text_SetString( TextID_50, NumtoStr( Fib_50, NumDecimals ) + " - 50.0%" ) ;  
			Text_SetLocation( TextID_50, Date, Time, Fib_50 ) ; 
			end ; 
			 
		if TextID_618 > 0 then 
			begin 
			Text_SetString( TextID_618, NumtoStr( Fib_618, NumDecimals ) + " - 61.8%" ) ;  
			Text_SetLocation( TextID_618, Date, Time, Fib_618 ) ; 
			end ; 
	 
		if TextID_236 > 0 then 
			begin 
			Text_SetString( TextID_236, NumtoStr( Fib_236, NumDecimals ) + " - 23.6%" ) ;  
			Text_SetLocation( TextID_236, Date, Time, Fib_236 ) ; 
			end ; 
			 
		if TextID_764 > 0 then 
			begin 
			Text_SetString( TextID_764, NumtoStr( Fib_764, NumDecimals ) + " - 76.4%" ) ;  
			Text_SetLocation( TextID_764, Date, Time, Fib_764 ) ; 
			end ; 
			 
		if TextID_Alert > 0 then  
			begin 
			Text_SetString( TextID_Alert, NumtoStr( Alert_Price, NumDecimals ) + " - " + AlertLevelTxt + "%" ) ;  
			Text_SetLocation( TextID_Alert, Date, Time, Alert_Price ) ; 
			end ; 
	end ;			  
 
// Alerts 
if Close crosses over Alert_Price then 
	Alert( "Crossing Over " + AlertLevelTxt + "% Level" ) 
else if Close crosses under Alert_Price then 
	Alert( "Crossing Under " + AlertLevelTxt + "% Level" ) ;	 
	 

Note: It is possible to make “same as selected” scaling option activated directly from the indicator code without acting on external params by doing the following from the chart:
Format Analysis Technique -> Scaling (tab) -> Scale On : Same Axis as Underlying Data. Once this is set, select the default button on that screen. The indicator should use this setting when it is applied in the future. 

Example 5
Here is an example of the multi day fibs with an extension and retracement drawn. You could add other levels as desired. Note that in the screen shot below I’ve set the input IncludeCurrentDay to false so that the current day is not considered in finding the High and Low values on which to base the fibs. 

using elsystem ; 
using elsystem.collections ; 
 
inputs:  
	ExtendLinesRight( true ),  
	ExtendLinesLeft( false ),  
	Style_0_100( Tool_Solid ),  
	Color_0_100( Magenta ),  
	Style_Fibs( Tool_Dashed ),  
	Color_Fibs( Cyan ), 
	Color_Alert( Green ), 
	ShowLabels( true ), 
	LabelsLeft( false ), 
	AlertLevel( 23.6 ), 
	ShowAlertTL( false ), 
	UseSessionOrDateChange_0_or_1( 0 ), 
 	IncludeCurrentDay( true ), 
	NumDays( 3 ) ;   
  
variables:  
	int TLID_0( 0 ),  
	int TLID_100( 0 ),  
	int TLID_50( 0 ),  
	int TLID_618( 0 ),  
	int TLID_382( 0 ),  
	int TLID_236( 0 ),  
	int TLID_764( 0 ), 
	int TLID_N618( 0 ),  
	int TLID_P618( 0 ),  
	int TextID_0( 0 ),  
	int TextID_100( 0 ),  
	int TextID_50( 0 ),  
	int TextID_618( 0 ),  
	int TextID_382( 0 ),  
	int TextID_236( 0 ),  
	int TextID_764( 0 ), 
 	int TextID_N618( 0 ),  
	int TextID_P618( 0 ), 
	int TLID_Alert( 0 ), 
	int TextID_Alert( 0 ), 
	double LowOfDay( 0 ),  
	double HighOfDay( 0 ),  
	double HiLoDiff( 0 ),  
	double Fib_50( 0 ),  
	double Fib_618( 0 ),  
	double Fib_382( 0 ),  
	double Fib_236( 0 ),  
	double Fib_764( 0 ), 
	double Fib_N618( 0 ),  
	double Fib_P618( 0 ),  
 	double Alert_Price( 0 ), 
	int TL_StartTime( 0 ),  
	int TL_StartDate( 0 ), 
	int NumDecimals( 0 ), 
	string AlertLevelTxt( NumToStr( AlertLevel, 1 ) ), 
	Vector OHLCV_Vector( NULL ),  
	Vector HighVector( NULL ),  
	Vector LowVector( NULL ),  
	int CSReg( 0 ),  
	bool ResetCalcs( false ),  
	intrabarpersist bool OkToCall( false ),  
	int RtnValOrErrorCode( 0 ),  
	int LabelAlign( iff( LabelsLeft, 1, 0 ) ) ;  
 
method override void InitializeComponent() 
	begin 
	self.initialized += init; 
	end;  
 
method void Init( Object InitSender, InitializedEventArgs InitArgs )  
	begin 
	OHLCV_Vector = new Vector ;  
	HighVector = new Vector ; 
	LowVector = new Vector ; 
	if BarType >= 2 then 
		RaiseRuntimeError( "This indicator works with tick or intraday bars." ) ; 
	end ; 
 
if UseSessionOrDateChange_0_or_1 = 0 then 
	begin 
	CSReg = CurrentSession( 1 ) ; { current regular session } 
	ResetCalcs = CSReg <> CSReg[1] ; { change of regular session } 
	end 
else 
	ResetCalcs = Date <> Date[1] ; 
 
once ( RtnValOrErrorCode > NumDays )  
	OkToCall = true ; 
 
RtnValOrErrorCode = OHLCVCollection( ResetCalcs, true, OHLCV_Vector ) ; 
 
if ResetCalcs then 
	begin 
	TL_StartTime = Time ; 
	TL_StartDate = Date ; 
	end ; 
 
once  
	begin 
	HighVector = OHLCV_Vector[1] astype Vector ; { [1] = High Prices } 
	LowVector = OHLCV_Vector[2] astype Vector ; { [2] = Low Prices } 
	end ; 
 
if OkToCall then  
	begin 
	if IncludeCurrentDay then 
		begin 
		HighofDay = Highest( HighVector, NumDays ) ; 
		LowofDay = Lowest( LowVector, NumDays ) ; 
		end 
	else 
		begin 
		HighofDay = Highest( HighVector, NumDays )[1] ; 
		LowofDay = Lowest( LowVector, NumDays )[1] ; 
		end ; 
	end  
else if LastBarOnChart then 
	RaiseRuntimeError( "High and low not available for requested number of days " + 
	 "or sessions.  Try loading more historical data." ) ;  
 
 
 
// Create TLs / Labels / Calc Decimal Places one time  
Once  
	begin  
	if Category = 12 then  
		NumDecimals = Log( PriceScale ) / Log( 10 ) - 1  
	else  
		NumDecimals = Log( PriceScale ) / Log( 10 ) ;   
	  
	  
	  
	TLID_0 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_0, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_0, true ) ;  
	TL_SetStyle( TLID_0, Style_0_100 ) ;  
	TL_SetColor( TLID_0, Color_0_100 ) ;  
	  
	TLID_100 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_100, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_100, true ) ;  
	TL_SetStyle( TLID_100, Style_0_100 ) ;  
	TL_SetColor( TLID_100, Color_0_100 ) ;  
	  
	TLID_50 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_50, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_50, true ) ;  
	TL_SetStyle( TLID_50, Style_Fibs ) ;  
	TL_SetColor( TLID_50, Color_Fibs ) ;  
	  
	TLID_618 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_618, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_618, true ) ;  
	TL_SetStyle( TLID_618, Style_Fibs ) ;  
	TL_SetColor( TLID_618, Color_Fibs ) ;  
	  
	TLID_382 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_382, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_382, true ) ;  
	TL_SetStyle( TLID_382, Style_Fibs ) ;  
	TL_SetColor( TLID_382, Color_Fibs ) ;  
	  
	TLID_236 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_236, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_236, true ) ;  
	TL_SetStyle( TLID_236, Style_Fibs ) ;  
	TL_SetColor( TLID_236, Color_Fibs ) ;  
	  
	TLID_764 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_764, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_764, true ) ;  
	TL_SetStyle( TLID_764, Style_Fibs ) ;  
	TL_SetColor( TLID_764, Color_Fibs ) ;  
	  
	TLID_N618 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_N618, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_N618, true ) ;  
	TL_SetStyle( TLID_N618, Style_Fibs ) ;  
	TL_SetColor( TLID_N618, Color_Fibs ) ;  
	  
	TLID_P618 = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
	if ExtendLinesRight then TL_SetExtRight( TLID_P618, true ) ;  
	if ExtendLinesLeft then TL_SetExtLeft( TLID_P618, true ) ;  
	TL_SetStyle( TLID_P618, Style_Fibs ) ;  
	TL_SetColor( TLID_P618, Color_Fibs ) ;  
 
 
	if ShowAlertTL then 
		begin  
		TLID_Alert = TL_New( Date, Time, Open, Date, Time, Open ) ;	  
		if ExtendLinesRight then TL_SetExtRight( TLID_Alert, true ) ;  
		if ExtendLinesLeft then TL_SetExtLeft( TLID_Alert, true ) ;  
		TL_SetStyle( TLID_Alert, Style_Fibs ) ;  
		TL_SetColor( TLID_Alert, Color_Alert ) ; 
		end ; 
	 
	if ShowLabels then 
		begin 
		TextID_0 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_0, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_0, Color_0_100 ) ; 
			 
		TextID_100 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_100, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_100, Color_0_100 ) ; 
		 
		TextID_50 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_50, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_50, Color_Fibs ) ; 
			 
		TextID_618 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_618, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_618, Color_Fibs ) ; 
			 
		TextID_382 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_382, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_382, Color_Fibs ) ; 
			 
		TextID_236 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_236, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_236, Color_Fibs ) ; 
		 
		TextID_764 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_764, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_764, Color_Fibs ) ; 
		 
		TextID_N618 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_N618, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_N618, Color_Fibs ) ; 
		 
		TextID_P618 = Text_New( Date, Time, Close, " " ) ; 
		Text_SetStyle( TextID_P618, LabelAlign, 1 ) ; ;  
		Text_SetColor( TextID_P618, Color_Fibs ) ; 
 
		if ShowAlertTL then 
			begin 
			TextID_Alert = Text_New( Date, Time, Close, " " ) ; 
			Text_SetStyle( TextID_Alert, LabelAlign, 1 ) ; ;  
			Text_SetColor( TextID_Alert, Color_Alert ) ; 
			end ;  
		end ;	 
	end ;  
  
  
  
//Calc fib levels  
HiLoDiff = HighOfDay - LowOfDay ;  
Fib_236 = HiLoDiff * .236  + LowOfDay ;  
Fib_382 = HiLoDiff * .382  + LowOfDay ;  
Fib_50 = HiLoDiff * .5 + LowOfDay ;  
Fib_618 = HiLoDiff * .618 + LowOfDay ;  
Fib_764 = HiLoDiff * .764 + LowOfDay ; 
Fib_N618 = LowOfDay - HiLoDiff * .618 ;   
Fib_P618 = HighOfDay + HiLoDiff * .618 ;   
Alert_Price =  HiLoDiff * AlertLevel * .01 + LowOfDay ; 
  
//Adjust trend lines  
if TLID_0 > 0 then  
	begin  
	TL_SetBegin( TLID_0, TL_StartDate, TL_StartTime, LowOfDay ) ;  
	TL_SetEnd( TLID_0, Date, Time, LowOfDay ) ;  
	end ;  
  
if TLID_100 > 0 then  
	begin  
	TL_SetBegin( TLID_100, TL_StartDate, TL_StartTime, HighOfDay ) ;  
	TL_SetEnd( TLID_100, Date, Time, HighOfDay ) ;  
	end ;  
  
if TLID_382 > 0 then  
	begin  
	TL_SetBegin( TLID_382, TL_StartDate, TL_StartTime, Fib_382 ) ;  
	TL_SetEnd( TLID_382, Date, Time, Fib_382 ) ;  
	end ;  
  
if TLID_50 > 0 then  
	begin  
	TL_SetBegin( TLID_50, TL_StartDate, TL_StartTime, Fib_50 ) ;  
	TL_SetEnd( TLID_50, Date, Time, Fib_50 ) ;  
	end ;  
	  
if TLID_618 > 0 then  
	begin  
	TL_SetBegin( TLID_618, TL_StartDate, TL_StartTime, Fib_618 ) ;  
	TL_SetEnd( TLID_618, Date, Time, Fib_618 ) ;  
	end ;	  
	  
if TLID_236 > 0 then  
	begin  
	TL_SetBegin( TLID_236, TL_StartDate, TL_StartTime, Fib_236 ) ;  
	TL_SetEnd( TLID_236, Date, Time, Fib_236 ) ;  
	end ;  
	  
if TLID_764 > 0 then  
	begin  
	TL_SetBegin( TLID_764, TL_StartDate, TL_StartTime, Fib_764 ) ;  
	TL_SetEnd( TLID_764, Date, Time, Fib_764 ) ;  
	end ;		  
 
if TLID_N618 > 0 then  
	begin  
	TL_SetBegin( TLID_N618, TL_StartDate, TL_StartTime, Fib_N618 ) ;  
	TL_SetEnd( TLID_N618, Date, Time, Fib_N618 ) ;  
	end ;  
	  
if TLID_P618 > 0 then  
	begin  
	TL_SetBegin( TLID_P618, TL_StartDate, TL_StartTime, Fib_P618 ) ;  
	TL_SetEnd( TLID_P618, Date, Time, Fib_P618 ) ;  
	end ;	  
 
 
 
 
 
if TLID_Alert > 0 then 
	begin  
	TL_SetBegin( TLID_Alert, TL_StartDate, TL_StartTime, Alert_Price ) ;  
	TL_SetEnd( TLID_Alert, Date, Time, Alert_Price ) ;  
	end ; 
	 
 
// Update labels 
if ShowLabels then 
	begin 
		if TextID_0 > 0 then 
			begin 
			Text_SetString( TextID_0, NumtoStr( LowOfDay, NumDecimals ) + " - 00.0%" ) ;  
			Text_SetLocation( TextID_0, Date, Time, LowOfDay ) ; 
			end ; 
			 
		if TextID_100 > 0 then 
			begin 
			Text_SetString( TextID_100, NumtoStr( HighOfDay, NumDecimals ) + " - 100.0%") ;  
			Text_SetLocation( TextID_100, Date, Time, HighOfDay ) ; 
			end ; 
		 
		if TextID_382 > 0 then 
			begin 
			Text_SetString( TextID_382, NumtoStr( Fib_382, NumDecimals ) + " - 38.2%" ) ;  
			Text_SetLocation( TextID_382, Date, Time, Fib_382 ) ; 
			end ; 
	 
		if TextID_50 > 0 then 
			begin 
			Text_SetString( TextID_50, NumtoStr( Fib_50, NumDecimals ) + " - 50.0%" ) ;  
			Text_SetLocation( TextID_50, Date, Time, Fib_50 ) ; 
			end ; 
			 
		if TextID_618 > 0 then 
			begin 
			Text_SetString( TextID_618, NumtoStr( Fib_618, NumDecimals ) + " - 61.8%" ) ;  
			Text_SetLocation( TextID_618, Date, Time, Fib_618 ) ; 
			end ; 
	 
		if TextID_236 > 0 then 
			begin 
			Text_SetString( TextID_236, NumtoStr( Fib_236, NumDecimals ) + " - 23.6%" ) ;  
			Text_SetLocation( TextID_236, Date, Time, Fib_236 ) ; 
			end ; 
			 
		if TextID_764 > 0 then 
			begin 
			Text_SetString( TextID_764, NumtoStr( Fib_764, NumDecimals ) + " - 76.4%" ) ;  
			Text_SetLocation( TextID_764, Date, Time, Fib_764 ) ; 
			end ; 
			 
 
		if TextID_N618 > 0 then 
			begin 
			Text_SetString( TextID_N618, NumtoStr( Fib_N618, NumDecimals ) + " - (-61.8%)" ) ;  
			Text_SetLocation( TextID_N618, Date, Time, Fib_N618 ) ; 
			end ; 
			 
		if TextID_P618 > 0 then 
			begin 
			Text_SetString( TextID_P618, NumtoStr( Fib_P618, NumDecimals ) + " - 161.8%" ) ;  
			Text_SetLocation( TextID_P618, Date, Time, Fib_P618 ) ; 
			end ; 
 
 
		if TextID_Alert > 0 then  
			begin 
			Text_SetString( TextID_Alert, NumtoStr( Alert_Price, NumDecimals ) + " - " + AlertLevelTxt + "%" ) ;  
			Text_SetLocation( TextID_Alert, Date, Time, Alert_Price ) ; 
			end ; 
	end ;			  
 
// Alerts 
if Close crosses over Alert_Price then 
	Alert( "Crossing Over " + AlertLevelTxt + "% Level" ) 
else if Close crosses under Alert_Price then 
	Alert( "Crossing Under " + AlertLevelTxt + "% Level" ) ;	 
	 

更新于 2020年6月3日

这篇文章对您有帮助吗?

相关的话题

留言评论