Confirming A Signal

Overview

Often with Prorealtime Trading Systems a number of indicators are combined to create an entry signal with a couple of filters added to only take them at certain times or above technical levels but sometimes and indicator can require confirmation. Such examples include the Harmonic Trading Patterns whose signal create a reversal zone and additional tools are used to confirm the next move.

If you want to learn more about Harmonic Pattern Trading please check out the linked article series.

When creating the Siren Series systems based on harmonic patterns one of the things that I had found in the research was that the entry signal generated from the indicator was not the best place to get in

With the indicator showing potential reversal opportunities then I did not want to take the signal straight away but to wait for the price level to reverse through the level at which the signal was generated

I also did not want to wait too long before the signal was no longer valid, on higher time frames 8 bars was suggested but having spent some time working on it I found that 15 bars at most worked very well when optimising the system

I hope your will find the prorealtime code below useful and if you have any questions please add them to the comments


Variables

 

bars //number of bars in which the price level has to cross above the signal line to generate a long position

sbars //number of bars in which the price level has to cross above the signal line to generate a short position


Main Code Long Positions

 

IF longentrysignal THEN //replace with your entry signal conditions
triggerlonglevel = close //saves the level the signal was created at
myindexlong = barindex //saves the bar the signal was created on
endif

if notonmarket and close > triggerlonglevel and BarIndex >= MyIndexlong + numberofbars THEN //if the close > the saved signal level and there have been less bars than the bars value (myindexlong is a negative number)
BUY positionsize PERPOINT AT MARKET
SET STOP %LOSS varsl
SET TARGET %PROFIT vartp
triggerlonglevel = 100000 //resets the trigger level when a position is open
ENDIF

Main Code Short Positions

if shortentrysignal then
triggershortlevel = close
myindexshort = barindex
endif

if notonmarket and close < triggershortlevel and BarIndex >= MyIndexshort + numberofbarsshort then
SELLSHORT positionsize PERPOINT AT MARKET
SET STOP %LOSS varsls
SET TARGET %PROFIT vartps
triggershortlevel = 0
endif


Example

System In Build With Default Bars and Sbars = 8

Prorealtime backtesting optimisation

System In Build Following Optimisation Of Bars

Bars = 13 and Sbars = 1

Leave a Comment