Madrid
Posts: 10 since Feb 2018
Thanks Given: 0
Thanks Received: 0
|
Apologies in advance I am an absolute beginner
I coded a simple indicator to plot 3 moving averages
Then I add the condition of the first 2 crossing
I want to apply this indicator to the Radar where I have selected some values
My info extraction would be very simple at first:
- Future / Stock - Date - Value at which the 2 Moving Averages have crossed
but get data extraction only in the date in which I have a crossing, I don't need the Dates and Values without any Moving average crossing
I have managed to write the Plot part, even the Condition, but I don't know how to code the Print part
Your help would be really appreciated
My coding:
Inputs:
Price (Close),
Length1 (2),
Length2 (11),
Length3 (22),
ConfirmBars( 1 ) ;
Variables:
FileName (" "),
Counter( 0 );
{ Plot1 Averages on chart }
Plot1 ( AverageFC(Price , Length1), "Avg1");
Plot2 ( AverageFC(Price , Length2), "Avg2");
Plot3 ( AverageFC(Price , Length3), "Avg3");
if AverageFC(Price, Length1) > AverageFC( Price, Length2 ) then
Counter = Counter + 1;
if Counter = ConfirmBars then
Print ("Date -",ELDateToString(Date)," Avg1", Plot1:3.3, " Avg2", Plot2:3:4, " Avg3", Plot3:3:5) ;
If Currentbar = 1 then Print(File("C:\TestTemp.txt"),"Date - ",";"," Avg1 ",";"," Avg2 ",";"," Avg3 ") ;
Print(File("C:\TestTemp.txt"), ELDateToString(Date),";", Plot1:3.3, ";", Plot2:3:4, ";", Plot3:3:5) ;
|