Study Line Crossover

#1
Dear Members,

I have created all support and resistances line in my Amibroker and marked them as "SU" and "RE" on default layer as indicated in help files.

i am using following two line code for crossover detection , but explore/scan is not generating any result however i am able to see crossover on my chart.

Sell = Cross( Study("SU"), Close );
Sell = Cross( Close ,Study("RE") );


Please help if any thing is missing.

Output will be in following format :

1. Script name.
2. Date.
3. SU/RE (Whatever crossover has been occured)
4. Buy or Sell.

Thanks ...
 
#5
You may like to make your own changes to the following:

/* Exploration to identify symbols which closed near (either above or below)
the manually drawn support lines. (Three support lines S1, S2 & S3 will
be manually drawn on all charts and periodically updated.
The timeframe used will be weekly as we are interested in core trading */


TimeFrameSet( inWeekly); // Switch to weekly time frame
Tol = Param("Desired Tolerence between Close and Support Line (%)",10,2.5,20,2.5); // Tolerence

Sup1 = Study("S1"); // Support line 1
Sup2 = Study("S2"); // Support line 2
Sup3 = Study("S3"); // Support line 3

Filter = (C * Tol/100 >= abs(C - Sup1)); // Filter

/* Columns headers, we want */
AddColumn(Close,"Close",1.2);
AddColumn(Sup1, "S 1",1.2, textColor = colorDarkGreen);
AddColumn(abs(C - Sup1)/C*100 ,"S1 %",1, textColor = colorDarkGreen);
AddColumn(Sup2, "S 2",1.2, textColor = colorDarkGreen);
AddColumn(abs(C - Sup2)/C*100 ,"S2 %",1, textColor = colorDarkGreen);
AddColumn(Sup3, "S 3",1.2, textColor = colorDarkGreen);
AddColumn(abs(C - Sup3)/C*100 ,"S3 %",1, textColor = colorDarkGreen);

TimeFrameRestore(); // restore time frame to original
 

Similar threads