{ OTTAPOINTS Indicator draws horizontal line and write price on the chart where entry should be placed according to the Oattarder overlap method. In honor of the trader who is sharing the trading concept, I call this indicator oatpoints indicator Settings: I have black background and green/red candle stick bar colors draws green horizontal lines for buy price draws red horizontal lines for sell price when isWriteTxt is set to true writes green text for buy price writes red text for sell price I turn update every tick option off ... it does not make any sense to plot tick by tick, but makes sense to plot at the end bar completion. } Input: blnColor(Green), blnSize(0), blnStyle(Tool_Solid), slnColor(Red), slnSize(0), slnStyle(Tool_Solid), isWriteTxt(true), btxtHA(1), stxtHA(1), { HA = Horizontal Alignment } btxtVA(4), stxtVA(4), { VA = Vertical Alignment } btxtColor(Green), stxtColor(Red), isPlotPivotBars(true), isPlotEntryBars(true); {Minimum bars that are required before the study can do any thing } var: MIN_NUM_BARS(3); { Constants to detect the formation } var: left(2), middle(1), right(0); {variable to track where the right most bar exist for up pivot point detection} var: upPvtSkip(0); {up pivot point detected flag } var: isUpPvtFound(false); { Buy Pivot Point } Var: bpvt(0); {Buy state } Var: bst(0); { 0 = pivot looking, 1 = break out} { to remeber the buy pivot bar } Var: bbar(0); { temp variable for drawing horizontal line for buy price } Var: bln(0); { temp variable for writing buy price on screen } Var: btxt(0); { Buy Entry Price } Var: betry(0); {variable to track where the right most bar exist for down pivot point detection} var: dnPvtSkip(0); {down pivot point detected flag } var: isDnPvtFound(false); { Sell Pivot Point } Var: spvt(0); {Sell State } Var: sst(0); { 0 = pivot looking, 1 = break out } { to remeber the sell pivot bar } Var: sbar(0); { temp variable for drawing horizontal line for sell price } Var: sln(0); { temp variable for writing sell price on screen } Var: stxt(0); { Sell Entry Price } Var: setry(0); { temp variable for bar number calculation } Var: barNo(0); { Check if we are waiting for buy entry } if (betry <> 0)then begin { we assume if low of the bar touches our entry point or it less then our entry point we got entry } if (l <= betry ) then begin if (isPlotEntryBars = true) then plot3(l); { Initialize the entry price } betry = 0; end; end; { Check if we are waiting for sell entry } if (setry <> 0) then begin { we assume if low of the bar touches our entry point or it less then our entry point we got entry } if (h >= setry ) then begin if (isPlotEntryBars = true) then plot4(h); { Initialize the entry price } setry = 0; end; end; { Check if we are waiting for up side breakout } if (bst = 1) then begin { Check if we got the price that is higher than the pivot bar high and the bar closes above the pivot } if ( H > bpvt ) and ( c > bpvt) then begin { draw the line at the buy price} { determine where the line should start, it will end on the break out bar } barNo = Currentbar - bbar + 1; { draw the line from pivot point to the break out bar } bln = TL_New( Date[barNo],Time[barNo],bpvt,Date,Time,bpvt); { set the line color as specified by the user } TL_SetColor(bln,blnColor); { set the line size. size 0 allows to specifiy different sytles } TL_SetSize(bln,blnSize); { set the line style } TL_SetStyle(bln,blnStyle); { if price plot is requested then write the txt on the screen } if (isWriteTxt = true ) then begin btxt = Text_New(Date,Time,bpvt,"OB : "+NumToStr(bpvt,2)); { set the text style } Text_SetStyle(btxt,btxtHA,btxtVA); { set the text color } Text_SetColor(btxt,btxtColor); end; { remember the buy entry price } betry = bpvt; { forget the sell entry price } setry = 0; { Indicate that we are no longer looking for break out } bst = 0; end; end; { Check if we are waiting for down side breakout } if (sst = 1) then begin { Check if we got the price that is lower than the pivot bar low and the bar closes below the pivot } if ( L < spvt ) and (c < spvt) then begin { draw the line at the sell price} { determine where the line should start, it will end on the break out bar } barNo = Currentbar - sbar + 1; { draw the line from pivot point to the break out bar } sln = TL_New( Date[barNo],Time[barNo],spvt,Date,Time,spvt); { set the line color as specified by the user } TL_SetColor(sln,slnColor); { set the line size. size 0 allows to specifiy different sytles } TL_SetSize(sln,slnSize); { set the line style } TL_SetStyle(sln,slnStyle); { if price plot is requested then write the txt on the screen } if (isWriteTxt = true ) then begin stxt = Text_New(Date,Time,spvt,"OS : "+NumToStr(spvt,2)); { set the text style } Text_SetStyle(stxt,stxtHA,stxtVA); { set the text color } Text_SetColor(stxt,stxtColor); end; { remember sell entry price } setry = spvt; { forget the buy entry price } betry = 0; { Indicate that we are no longer for break out } sst = 0; end; end; { Check if we have minimum of three bars } if (currentbar > MIN_NUM_BARS) then begin { look for up pivot point } { check if middle bar high is higher than the left and right bars high } if ((h[middle] > h[left + upPvtSkip]) and (h[middle] > h[right])) then begin { mark that we have a pivot } isUpPvtFound = true; end else { we did not find the formation so check if middle bar high is higher than the left bar high } if (h[middle] > h[left + upPvtSkip]) then begin { check if middle bar high is equal to right bar high } if (h[middle] = h[right]) then begin { we remeber to skip one bar so that we keep track of left bar } upPvtSkip = upPvtSkip + middle; end else { right bar high is higher than the middle bar, so we have no formation and back to square one. right bar high can not be lower the the middle bar high at this point simply not possible or else program should crash and burn } upPvtSkip = right; end; { look for down pivot point } { check if middle bar low is lower than the left and right bars low } if ((l[middle] < l[left + dnPvtSkip]) and (l[middle] < l[right])) then begin { mark that we have a pivot } isDnPvtFound = true; end else { we did not find the formation so check if middle bar low is lower than the left bar low } if (l[middle] < l[left + dnPvtSkip]) then begin { check if middle bar low is equal to right bar low } if (l[middle] = l[right]) then begin { we remeber to skip one bar so that we keep track of left bar } dnPvtSkip = dnPvtSkip + middle; end else { right bar low is lower than the middle bar, so we have no formation and back to square one. right bar low can not be higher the the middle bar low at this point simply not possible or else program should crash and burn } dnPvtSkip = right; end; end; { detect amd remember high pivot point} If (isUpPvtFound = true) then begin { plot the pivot point } if (isPlotPivotBars = true ) then Plot1[middle](H[middle]); isUpPvtFound = false; upPvtSkip = right; { remember the high pivot point } bpvt = H[1]; { remember the high pivot point bar } bbar = currentbar; { Indicate that you are now waiting for breakout bar } bst = 1; end; { detect and remember low pivot point } If (isDnPvtFound = true) then begin if (isPlotPivotBars = true) then plot2[middle](L[middle]); isDnPvtFound = false; dnPvtSkip = right; { remember the low pivot point } spvt = L[middle]; { remember the low pivot point bar } sbar = currentbar; { Indicate that you are now waiting for breakout bar } sst = 1; end;