Como utilizar el indicador SAR para cerrar una posición?

By Herve Cayard - Last updated: martes, mayo 4, 2010 - Save & Share - Leave a Comment


El indicador Parabólico SAR (Stop and Reverse) permite identificar tendencias y se utiliza como stop dinámico o “trailing stop“.


Por mi parte, utilizo el indicador SAR para identificar el fin de una tendencia y el momento de cerrar la posición.



El código Tradestation para recuperar el evento (el “reverse” del SAR) es el siguiente:

//Inputs
Inputs:
SARAF(0.012),
 
//Declare variables to hold calculated values
Vars:
oParCl(0), oParOp(0), oPosition(0), oTransition(0),
 
//Variable assignment stores the calculation
SARData = ParabolicSAR (SARAF, 0.4, oParCl, oParOp, oPosition, oTransition);
MP = MarketPosition;
 
//We are long
if MP = 1 then
	//SAR exit
	if CurrentContracts = 1 then begin
		if close[1] >= oParOp[1] and close[0] < oParOp[0] then begin
			sell ("CL-StopSAR1") 1 contracts next bar at market;
		end;
	end;
end;
 
//We are short
if MP = -1 then
	//SAR exit
	if CurrentContracts = 1 then begin
		if close[1] <= oParOp[1] and close[0] > oParOp[0] then begin
			Buy to cover ("CS-StopSAR1") 1 contracts next bar at market;
		end;
	end;
end;

Posted in Trading • Tags: Top Of Page