// LOCALIZADOR DE DIVERGENCIAS INTERMERCADO - RUPERTACHO 2018 // NO OPERE ESTE SISTEMA , SE MUESTRA CON FINES EDUCATIVOS // NO TIENE STOPLOSS , NI PROFIT TARGET Inputs: NumDataToUse(2), LongShort(0), TipoDivergencia(1), LookBackTr(4), LookBackIntermaket(4), CorrelacionPositiva(0); Vars: IndicadorMercado(0),IndicadorInter(0); If TipoDivergencia=0 Then Begin IndicadorInter=Close of Data(NumDataToUse)-CLose[LookBackIntermaket] of Data(NumDataToUse); IndicadorMercado=CLose-CLose[LookBackTr]; end else Begin IndicadorInter=Close of Data(NumDataToUse)-Average(CLose of Data(NumDataToUse),LookBackIntermaket); IndicadorMercado=CLose-Average(CLose,LookBackTr); end; if CorrelacionPositiva=1 then begin If IndicadorInter>0 and IndicadorMercado<0 and LongShort>=0 then Buy Next Bar at open; If IndicadorInter<0 and IndicadorMercado>0 and LongShort<=0 then Sell Short Next Bar at open; If IndicadorInter>0 and IndicadorMercado<0 then Buy to Cover Next Bar at open; If IndicadorInter<0 and IndicadorMercado>0 then Sell Next Bar at open; end; if CorrelacionPositiva=0 then begin If IndicadorInter<0 and IndicadorMercado<0 and LongShort>=0 then Buy Next Bar at open; If IndicadorInter>0 and IndicadorMercado>0 and LongShort<=0 then Sell Short Next Bar at open; If IndicadorInter<0 and IndicadorMercado<0 then Buy to Cover Next Bar at open; If IndicadorInter>0 and IndicadorMercado>0 then Sell Next Bar at open;