ALEModerator
Master
Hello guys We can discuss about the strategy here, we can help together to develop strategies on the Indicator ” SCALPING INDICATOR”. This is the indicator posted in the Library there :https://www.prorealcode.com/prorealtime-indicators/scalping-indicator-2/
Here below some example of the operation of the indicator.
ALEModerator
Master
Hello Here below a new version of Scalping Indicator
// SCALPING DAX INIDCATOR, USABLE ON ANY TOOL, SET UP TIME FRAME 1 MINUTE.
// PRC CONTRIBUTE_ ALE_15/12/2017
DEFPARAM CALCULATEONLASTBARS=50000
//WHB=6
//WHS=6
//BIB=6
//BIS=6
//PPKKS=0.994
//PPKKB=0.994
//RES=3
//SUP=3
//FUP=1000
//FDW=2000
//P01=1/0
//P02=1/0
//P03=1/0
//P04=1/0
//P05=1/0
//P06=1/0
//CLO= 1/0
// GRAPHIC VARIABLES
PIP = 1*Pipsize //ARROW DISTANCE
LIN = 10 //LENGTH OF SEGMENT OF SUPPORT OR RESISTENCE
RESISTENCE = RES*Pipsize //DISTANCE OF THE SEGMENT OF THE RESISTENCE
SUPPORT = SUP*Pipsize //DISTANCE OF THE SEGMENT OF THE SUPPORT
// ENABLED PATTERN 1-0 / ON-OFF
ONCE PrEnabled01 = P01 // SWITCH INDICATOR P01,P02 ETC ..
ONCE PrEnabled02 = P02
ONCE PrEnabled03 = P03
ONCE PrEnabled04 = P04
ONCE PrEnabled05 = P05
ONCE PrEnabled06 = P06
ONCE TimeEnabled = CLO // FOR DAILY TIMEFRAME DISABLE TIMEWINDOW
//////////////////////////////////////////////////////////////////////
// MODIFIED UNIVERSAL OSCILLATOR 1
whitenoiseB= (Close - Close[WHB])
if barindex>BIB then
a11= exp(-1.414 * 3.14159 / BIB)
b11= 2*a11 * Cos(1.414*180 /BIB)
c22= b11
c33= -a11 * a11
c11= 1 - c22 - c33
filtB= c11 * (whitenoiseB + whitenoiseB[1])/2+ c22*filtB[1] + c33*filtB[1]
filt11 = filtB
if ABS(filt11)>pkB[1] then
pkB = ABS(filt11)
else
pkB = PPKKS * pkB[1]
endif
if pkB=0 then
denomB = -1
else
denomB = pkB
endif
if denomB = -1 then
resultB = resultB[1]
else
resultB = filt11/pkB
endif
endif
// MODIFIED UNIVERSAL OSCILLATOR 2
whitenoise= (Close - Close[WHS])
if barindex>BIS then
// super smoother filter
a1= (-1.414 * 3.14159 / BIS)
b1= 2*a1 * Cos(1.414*180 /BIS)
c2= b1
c3= -a1 * a1
c1= 1 - c2 - c3
filt= c1 * (whitenoise + whitenoise[1])/2+ c2*filt[1] + c3*filt[1]
filt1 = filt
if ABS(filt1)>pk[1] then
pk = ABS(filt1)
else
pk = PPKKB * pk[1]
endif
if pk=0 then
denom = -1
else
denom = pk
endif
if denom = -1 then
resultS = resultS[1]
else
resultS = filt1/pk
endif
endif
IF BARINDEX>50 THEN
//FORCEINDEX INDICATOR FILTER
Fi=FORCEINDEX(close)
// TIME WINDOW
TimeWindow= (TIME >=80000 and time <=210000)
FilTime=(TimeWindow or not TimeEnabled)
//////////////////////////////////////////////////////////////////////
//PATTERN UP 1
PrUp01 = RESULTS[3]>RESULTS[2]
PrUp01 = PrUp01 and RESULTS[2]< RESULTS[1]
PrUp01 = PrUp01 and RESULTS[2]<=-1
PrUp01 = (PrUp01 and PrEnabled01)
//PATTERN DOWN 1
PrDW01 = RESULTS[3]<RESULTS[2]
PrDw01 = PrDw01 and RESULTS[2]> RESULTS[1]
PrDw01 = PrDw01 and RESULTS[2]>=1
PrDw01 = (PrDw01 and PrEnabled01)
//PATTERN UP 2
PrUp02 = resultS<=-0.95
PrUp02 = PrUp02 and resultS[1]<=-1
PrUp02 = (PrUp02 and PrEnabled02)
//PATTERN DOWN 2
PrDw02 = resultS>=0.95
PrDw02 = PrDw02 and resultS[1]>=1
PrDw02 = (PrDw02 and PrEnabled02)
//PATTERN UP 3
PrUp03 = close < open
PrUp03 = PrUp03 and low < low[1]
PrUp03 = PrUp03 and resultS<=-1
PrUp03 = PrUp03 and Fi<-FDw
PrUp03 = (PrUp03 and PrEnabled03)
//PATTERN DOWN 3
PrDW03 = close > open
PrDw03 = PrDw03 and high > high[1]
PrDw03 = PrDw03 and resultS>=1
PrDw03 = PrDw03 and Fi>FUp
PrDw03 = (PrDw03 and PrEnabled03)
//PATTERN UP 4
PrUp04 = resultS<=-0.95
PrUp04 = PrUp04 and resultS[1]<=-1
PrUp04 = PrUp04 and Fi<-FDw
PrUp04 = (PrUp04 and PrEnabled04)
//PATTERN DOWN 4
PrDw04 = resultS>=0.95
PrDw04 = PrDw04 and resultS[1]>=1
PrDw04 = PrDw04 and Fi>FUp
PrDw04 = (PrDw04 and PrEnabled04)
//PATTERN UP 5
PrUp05 = resultS<=-0.95
PrUp05 = PrUp05 and Fi[1]<Fi
PrUp05 = PrUp05 and Fi[1]<-FDw
PrUp05 = (PrUp05 and PrEnabled05)
//PATTERN DOWN 5
PrDw05 = resultS>=0.95
PrDw05 = PrDw05 and Fi[1]>Fi
PrDw05 = PrDw05 and Fi[1]>FUp
PrDw05 = (PrDw05 and PrEnabled05)
//PATTERN UP 6
PrUp06 = results <-0.5
PrUp06 = PrUp06 and results crosses over resultb
PrUp06 = (PrUp06 and PrEnabled06)
//PATTERN DOWN 6
PrDw06 = results >0.5
PrDw06 = PrDw06 and results crosses under resultb
PrDw06 = (PrDw06 and PrEnabled06)
//////////////////////////////////////////////////////////////////////
// COLORS OF THE ARROW AND SEGMENT
IF PrUp01 THEN
R=0
G=128
B=255
ELSIF PrUp02 THEN
R=0
G=255
B=128
ELSIF PrUp03 THEN
R=255
G=255
B=102
ELSIF PrUp04 THEN
R=255
G=153
B=255
ELSIF PrUp05 THEN
R=242
G=90
B=161
ELSIF PrDw01 THEN
R=0
G=128
B=255
ELSIF PrDw02 THEN
R=0
G=255
B=128
ELSIF PrDw03 THEN
R=255
G=255
B=102
ELSIF PrDw04 THEN
R=255
G=153
B=255
ELSIF PrDw05 THEN
R=242
G=90
B=161
ELSIF PrDw06 THEN
R=200
G=0
B=161
ENDIF
If Filtime then
if PrUp01 OR PrUp02 OR PrUp03 OR PrUp04 OR PrUp05 OR PrUp06 then
DRAWARROWUP(barindex,LOW-PIP)coloured(R,G,B)
DRAWSEGMENT(barindex,LOW-SUPPORT,barindex-LIN, LOW-SUPPORT )coloured(R,G,B)
elsif PrDw01 OR PrDw02 OR PrDw03 OR PrDw04 OR PrDw05 OR PrDw06 then
DRAWARROWDOWN(barindex,HIGH+PIP)coloured(R,G,B)
DRAWSEGMENT(barindex,HIGH+RESISTENCE,barindex-LIN, HIGH+RESISTENCE)coloured(R,G,B)
endif
endif
ENDIF
RETURN
Hi Ale,
The V3 looks great too, but I need some help to understand the meaning of the colors. Could you explain a little please?
Thanks
Not wanting to seem a little picky but is this discussion about an indicator not posted in the wrong forum? ProBuilder Support is surely the better place for it?
On a separate note are you able to give a little summary of the principles behind the indicator so others can more understand the logic behind the coding? There are an awful lot of variables!
ALEModerator
Master
Hello,
Colors are fantasy nothing else. To differentiate the signals between them.
ALEModerator
Master
Here below attached strategy files as example, DAX 4H
DEFPARAM CUMULATEORDERS = FALSE
// INDICATOR'S VARIABLES
ONCE WHISEB = WHB //6
ONCE WHISES = WHS //6
ONCE BANDEDB = BIB //16
ONCE BANDEDS = BIS //16
ONCE PKKS = PPKKS //0.996
ONCE PKKB = PPKKB //0.993
// LONG AVERAGE FILTER ENTRY
ONCE avgEnterEnabled = AVGE // 0,1 ON-OFF
ONCE avgLongPeriod = AVGL // 200
// PATTERN ENTRY SELECTION
ONCE PrEnabled01 = P01 // 0,1 ON-OFF
ONCE PrEnabled06 = P06 // 0,1 ON-OFF
// MANAGE POSITION PERFORMANCE
ONCE trailingStopType = TRT // 0,1 ON-OFF
ONCE trailingstoplong = TSL // 7
ONCE trailingstopshort = TSS // 2
ONCE minstop = MTP // 10
ONCE barlong = BXL // 35
ONCE barshort = BXS // 15
ONCE timeStart = TIST // 080000
ONCE timeEnd = TIEN // 220000
ONCE TimeEnabled = OCLO // FOR DAILY TIMEFRAME DISABLE TIMEWINDOW 0/1
//TAKE PROFIT AND STOP LOSS
if longonmarket then
takeprofit =TPL // 1.3
stoploss =SLL // 2.8
ELSIF SHORTONMARKET THEN
takeprofit =TPS // 0.7
stoploss =SLS // 1.3
ENDIF
// MANAGE POSITION PERFORMANCE
//----------------------------------------------
atrtrail = AverageTrueRange[200]((close/10)*pipsize)/1000
trailingstartl = round(atrtrail*trailingstoplong) //trailing stop start and distance
trailingstartS = round(atrtrail*trailingstopshort)
if trailingStopType = TRT THEN // 1 TRAILING STOP
TGL =trailingstartl
TGS=trailingstarts
if not onmarket then
MAXPRICE = 0
MINPRICE = close
PREZZOUSCITA = 0
ENDIF
if longonmarket then
MAXPRICE = MAX(MAXPRICE,close)
if MAXPRICE-tradeprice(1)>=TGL*pointsize then
if MAXPRICE-tradeprice(1)>=MINSTOP then
PREZZOUSCITA = MAXPRICE-TGL*pointsize
ELSE
PREZZOUSCITA = MAXPRICE - MINSTOP*pointsize
ENDIF
ENDIF
ENDIF
if shortonmarket then
MINPRICE = MIN(MINPRICE,close)
if tradeprice(1)-MINPRICE>=TGS*pointsize then
if tradeprice(1)-MINPRICE>=MINSTOP then
PREZZOUSCITA = MINPRICE+TGS*pointsize
ELSE
PREZZOUSCITA = MINPRICE + MINSTOP*pointsize
ENDIF
ENDIF
ENDIF
if onmarket and PREZZOUSCITA>0 then
EXITSHORT AT PREZZOUSCITA STOP
SELL AT PREZZOUSCITA STOP
ENDIF
ENDIF
// LONG AVERAGE FILTER ENTRY
longAvg = Average[avgLongPeriod] (close)
avgFilterEnterLong = (close>longAvg OR NOT avgEnterEnabled)
avgFilterEnterShort = (close<longAvg OR NOT avgEnterEnabled)
//////////////////////////////////////////////////////////////////////
// MODIFIED UNIVERSAL OSCILLATOR 1
whitenoiseB= (Close - Close[WHISEB])
if barindex>BANDEDS then
a11= exp(-1.414 * 3.14159 / BANDEDS)
b11= 2*a11 * Cos(1.414*180 /BANDEDS)
c22= b11
c33= -a11 * a11
c11= 1 - c22 - c33
filtB= c11 * (whitenoiseB + whitenoiseB[1])/2+ c22*filtB[1] + c33*filtB[1]
filt11 = filtB
if ABS(filt11)>pkB[1] then
pkB = ABS(filt11)
else
pkB = PKKS * pkB[1]
endif
if pkB=0 then
denomB = -1
else
denomB = pkB
endif
if denomB = -1 then
resultB = resultB[1]
else
resultB = filt11/pkB
endif
endif
// MODIFIED UNIVERSAL OSCILLATOR 2
whitenoise= (Close - Close[WHISES])
if barindex>BANDEDB then
// super smoother filter
a1= (-1.414 * 3.14159 / BANDEDB)
b1= 2*a1 * Cos(1.414*180 /BANDEDB)
c2= b1
c3= -a1 * a1
c1= 1 - c2 - c3
filt= c1 * (whitenoise + whitenoise[1])/2+ c2*filt[1] + c3*filt[1]
filt1 = filt
if ABS(filt1)>pk[1] then
pk = ABS(filt1)
else
pk = PKKB * pk[1]
endif
if pk=0 then
denom = -1
else
denom = pk
endif
if denom = -1 then
resultS = resultS[1]
else
resultS = filt1/pk
endif
endif
//////////////////////////////////////////////////////////////////////
If barindex>1000 then
//PATTERN UP 1
PrUp01 = RESULTS[3]>RESULTS[2]
PrUp01 = PrUp01 and RESULTS[2]< RESULTS[1]
PrUp01 = PrUp01 and RESULTS[2]<=-1
PrUp01 = (PrUp01 and PrEnabled01)
//PATTERN DOWN 1
PrDW01 = RESULTS[3]<RESULTS[2]
PrDw01 = PrDw01 and RESULTS[2]> RESULTS[1]
PrDw01 = PrDw01 and RESULTS[2]>=1
PrDw01 = (PrDw01 and PrEnabled01)
//PATTERN UP 6
PrUp06 = results <-0.5
PrUp06 = PrUp06 and results crosses over resultb
PrUp06 = (PrUp06 and PrEnabled06)
//PATTERN DOWN 6
PrDw06 = results >0.5
PrDw06 = PrDw06 and results crosses under resultb
PrDw06 = (PrDw06 and PrEnabled06)
endif
//////////////////////////////////////////////////////////////////////
// // PATTERN ENTRY SELECTION
// TIME WINDOW
TimeWindow= (TIME >=TimeStart and time <=TimeEnd)
FilTime=(TimeWindow or not TimeEnabled)
If Filtime then
IF not shortonmarket and avgFilterEnterLong AND PrUp01 or PrUp06 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
IF not longonmarket and avgFilterEnterShort AND PrDw01 or PrDw06 THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
ENDIF
// MANAGE POSITION PERFORMANCE
IF POSITIONPERF<0 THEN
IF LongOnMarket AND BARINDEX-TRADEINDEX(1)>= barLong THEN
SELL AT MARKET
ENDIF
ENDIF
IF POSITIONPERF<0 THEN
IF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= barshort THEN
EXITSHORT AT MARKET
ENDIF
ENDIF
// MANAGE POSITION PERFORMANCE
SET STOP %LOSS stoploss
SET TARGET %PROFIT Takeprofit
//ENDIF
GRAPH TGL
Ah OK please ignore my suggestion about this being an indicator as we now have a strategy to play with!
ALEModerator
Master
Yes Vonasi, I thought to start with a strategy to simplify the concept.
I notice that the indicator is on a 1 minute time frame and the strategy is on a 4 hour time frame. Any reason for this as I usually assume that with scalping faster time frames are preferred.
ALEModerator
Master
this indicator is born for time low frame, but for the automatic strategies I dissuade him/it, because the probacktests would not be truthful. The data of IG don’t allow this.
Could be used by Scalping trader that are abled with low timeframe.
I have downloaded your ITF file for the v3 indicator and applied it to a DAX 1 minute chart but it draws nothing on the chart. I notice that your adjustable variables are set differently to those shown // in the code so tried them – but still nothing on the chart. Any ideas why I am getting nothing?
ALEModerator
Master
Have You Apply it on Chart? Have you Enabled P01 or P02 or … etc?
OK – so are you saying it is either P01 = TRUE or P02 = TRUE or P03 = TRUE etc etc? You exported the ITF with everything set to TRUE as a default. It has to load (very slowly) with this the first time (as it is impossible to edit an indicator before it has been added at least once) before anyone can set only one P0 to TRUE and then have to load it all again (very slowly).
If you find it slow to load at first time, add this line at the beginning of the code, it will prevent the indicator to calculate on all the history but on the last X bars you want:
DEFPARAM CALCULATEONLASTBARS=5000