hola buenas, quiero definir un profit y un stop para la estrategia cuando se da el punto de entrada, seria lo siguiente: stoch 14.2.1.. profit al cierre por encima (en compra) de 80 y (en venta ) por debajo de 20, sin antes tocar el precio , no al cierre, el minimo (en compra )o el maximo (en venta) de 5 o 6 velas atras.
a ver si Nicolas o Robertogozzi saben dar con la tecla
¿Qué significan las siguientes oraciones?
- sin antes tocar el precio
- el minimo (en compra )o el maximo (en venta) de 5 o 6 velas atras
Vale ..en compra…profit está cuando cierre de vela por encima del valor 80 en stoch 14.2.1 …y su stop ..estaría situado, una vez hecha la entrada, en el MINIMO de las 5/6 velas últimas velas contando desde donde se produce la entrada..igual en venta..pero el valor del stoch sería 20 y stop en el MAXIMO de las 5/6 velas atrás contando desde que se produce la entrada.
He aportado fotos para mayor claridad…si hace falta cuelgo la entrada exacta …GRACIAS SIEMPRE
Ahi esta:
ONCE LB = 5
ONCE OB = 80
ONCE OS = 100 - OB
stoK = Stochastic[14,2](close)
// LONG entry & exit
IF (stoK CROSSES OVER OS) AND (summation[LB](stoK <= OS) = LB)[1] AND Not LongOnMarket THEN
BUY 1 CONTRACT AT MARKET
SET STOP PRICE lowest[LB](low) //SL
ENDIF
IF stoK crosses OVER OB AND LongOnMarket THEN
SELL AT MARKET
ENDIF
// SHORT entry n& exit
IF (stoK CROSSES UNDER OB) AND (summation[LB](stoK >= OB) = LB)[1] AND Not ShortOnMarket THEN
SELLSHORT 1 CONTRACT AT MARKET
SET STOP PRICE highest[LB](high) //SL
ENDIF
IF stoK crosses UNDER OS AND ShortOnMarket THEN
EXITSHORT AT MARKET
ENDIF
Lo voy a probar robertogozzi..siempre mil gracias
Robertogozzi , aun le falta algo que definir….cuando el profit supera las 5 velas, no lo detecta, si el objetivo llega antes de las 5 siguientes velas si salta el profit si no ..no salta. Si se abre operacion y el profit estaen la 2,3,4,5 vela sin problema..en el stop pasa exactamente lo mismo, si el stop pasa 5 velas no lo detecta y no salta stop…Esto pasa igual tanto en compra como en venta…Aclarar que el punto de entrada no es con el stoch 14.2 es con macd y rsi ..te lo muestro
ATR=averagetruerange[30](close)*1.5
miMACD=exponentialAverage[4](close)-exponentialAverage[12](close)
signal=exponentialAverage[3](miMACD)
count=0
numerobarrasMACD=lookbars
a=rsi [7](close)
bajista= a<30.5
alcista= a>69.9
for i=0 to numerobarrasMACD do
if bajista[i] then
count=count+1
break
else
count=0
endif
next
c1=count
c2=miMACD crosses over signal
ONCE LB = 5
ONCE OB = 80
once OB2 = 20
stoK = Stochastic[14,2](close)
if time>085900 and time<=173000 then
if c1 and c2 then
buy 1 CONTRACT AT MARKET
endif
for i=0 to numerobarrasMACD do
if alcista [i] then
count=count+1
break
else
count=0
endif
next
c3=count
c4= miMACD crosses under signal
if time>085900 and time<=173000 then
if c3 and c4 then
SELLSHORT 0 CONTRACT AT MARKET
endif
endif
endif
ONCE LB = 5
ONCE OB = 80
ONCE OS = 100 - OB
stoK = Stochastic[14,2](close)
// LONG entry & exit
IF c2 AND (summation[LB](stoK <= OS) = LB)[1] AND Not LongOnMarket THEN
BUY 0 CONTRACT AT MARKET
SET STOP PRICE lowest[LB](low) //SL
ENDIF
IF stoK crosses OVER OB AND LongOnMarket THEN
SELL AT MARKET
ENDIF
// SHORT entry n& exit
IF c4 AND (summation[LB](stoK >= OB) = LB)[1] AND Not ShortOnMarket THEN
SELLSHORT 0 CONTRACT AT MARKET
SET STOP PRICE highest[LB](high) //SL
ENDIF
IF stoK crosses UNDER OS AND ShortOnMarket THEN
EXITSHORT AT MARKET
ENDIF
Me he atrancado y no doy con la tecla Robertogozzi..por FAVOR
¿Qué llave? No entiendo lo que quieres hacer y no entiendo lo que debo hacer.