Forums › ProRealTime English forum › ProScreener support › Unbroken highs › Reply To: Unbroken highs
01/08/2018 at 11:05 PM
#57816
Hi everyone, and thank you Roberto for your kind atention. I’m afraid I don’t completely understand your explanation.
I’m having the same error as ‘from8to800’ but, surprisingly my code fails just some times. Most times, it works fine. I don´t think its a network problem, because it fails always with the same stocks (for example, it fails if you try to backtest OTEX with 3000 bars)
The strategy tries to catch high capitalization breakouts, and I’m trying to optimise two variables: ‘volatilidad’ from 2 to 8 (step=3) and ‘misumacap’ from 100 to 300 (step=50).
Thanks in advance,
Miguel
breakout with high capitalization strategy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
DEFPARAM cumulateorders=false Capital = 100000 Risk = 1 REM Calculate contracts equity = Capital + StrategyProfit maxrisk = round(equity*(Risk/100)) riesgo=(priceopen-stoploss)*2 cap=volume*typicalprice sumacap=summation[5](cap) sumacap25=summation[25](cap) media5=sumacap25/5 supermediacap=100*sumacap/media5 //vola=ABS(highest[5](high)-lowest[5](low))*100/typicalprice alto=highest[5](high) bajo=lowest[5](low) vola=ABS(alto-bajo)*100/typicalprice //semana y día alcista if vola>=volatilidad and supermediacap>=misumacap and close>open[5] and close>open then condicion1=1 elsif condicion1[1]>0 and condicion1<5 and low>stoploss then condicion1=condicion1[1]+1 else condicion1=0 endif if condicion1=1 then priceopen = alto+((alto-bajo)*(5/100)) stoploss = bajo-((alto-bajo)*(5/100)) riesgo=(priceopen-stoploss)*2 PositionSize = abs(round(maxrisk/riesgo)) endif if condicion1>0 then BUY positionsize shares at priceopen stop endif GRAPH supermediacap coloured (0,200,0,255) as "supermediacap" GRAPH vola coloured (0,100,100,255) as "volatilidad" SET TARGET PROFIT riesgo SET STOP LOSS riesgo |