Forums › ProRealTime English forum › ProOrder support › Bollinger Bandit › Reply To: Bollinger Bandit
11/05/2018 at 8:36 AM
#84147
Here is the translated code for ProOrder:
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 |
defparam cumulateorders=false bollingerLengths=50 liqLength=50 rocCalcLength=30 avg = average[bollingerLengths] upBand = avg+std[bollingerlengths]*1.25 dnBand = avg-std[bollingerlengths]*1.25 rocCalc = Close - Close[rocCalcLength-1]// {remember to subtract 1} if(not longonmarket and rocCalc > 0) and close<upBand then Buy 1 contract at upBand stop endif if(not shortonmarket and rocCalc < 0) and close>dnBand then SellShort 1 contract at dnBand stop endif if not onmarket then liqDays = liqLength else liqDays = liqDays - 1 liqDays = Max(liqDays,10) endif if(longonmarket = 1 and Average[liqDays] < upBand) then Sell at Average[liqDays] stop endif if(shortonmarket = -1 and Average[liqDays] > dnBand) then exitshort at Average[liqDays] stop endif |
What timeframe and instrument suits the best the strategy? For what purpose it was designed for?