julesrulesny![]() Legend ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 498 Joined: 8/28/2009 Location: NYC ![]() | Hello, I forgot who wrote "SysTriggerLine". Who ever did it is one of the greatest, simplest trend following systems I have used.. A simple adjustment of the parameters at various times of the 24hour trading day, occasionally timed with some volatility indicator, or just patterns and price.. It becomes a masterful system to use on Forex.. And that is all one may need due to its simplicity. Works best during busiest rading hours around 3am to 10am and 5pm to 11pm when markets trend the most. anyways, my goal is to write this also as a STOP, so I can get reversing sigals and Enter re-enter when the signals change... I have tried writing this as a stop.. I have tried creating TWO strategies, one where SysTriggerLine fires as a LONG.. and another strategy where SysTriggerLine fires as a SHORT. Nothing seems to work.. I really want it to STOP out when it changes from Long to short and vice versa.. Then re-enter. As you can see in attachment "Points 1 2 3 4 Systrigger" .. (Point 1 is an enter for a Short, point A i'd like to exit, then re-enter as a LONG.. Point 2, exit the LONG, and re-enter as a SHORT.. And so on...). ***However, I tried something else as well - this didn't work either -- an early warning I noticed - **As you can see in attachment "Close Above Systrigger A"... Sometimes price will CLOSE above or below the SysTriggerLine BEFORE it actually changes from Long to Short, or Short to Long. **See below: "SysTriggerABstop" #Stop Dim sumof as Single Dim i as Integer Dim tmp as Single Dim wt as Single Dim lsma_ma as Single #Param "RPeriod" ,30,1,60 #Param "LSMA_Period" ,20,2,60 Dim myTRG As Single myTRG = systriggerline2 sumof = 0 For i = 0 To (RPeriod-1) tmp = ((RPeriod-i) - ((RPeriod+1)/3))*Close sumof = sumof + tmp Next wt = sumof*6/(Rperiod*(Rperiod+1)) lsma_ma = wt[1] + (wt-wt[1])*2/(LSMA_Period+1) If wt[1] < lsma_ma[1] and wt > lsma_ma Then Signal = LongSignal ElseIf wt[1] > lsma_ma[1] and wt < lsma_ma Then Signal = ShortSignal End If If wt > lsma_ma Then PlotPrice("wt", wt, Blue, 2) PlotPrice("lsma_ma", lsma_ma, Blue, 2) ElseIf wt < lsma_ma Then PlotPrice("wt", wt, Red, 2) PlotPrice("lsma_ma", lsma_ma, Red, 2) End If If Signal = LongSignal and C[1] < myTRG[1] and C > myTRG then Signal = exitSignal ElseIf If Signal = ShortSignal and C[1] > myTRG[1] and C < myTRG then Signal = exitSignal End If For what its worth, I'd rather just enter/exit as reversing signals.. So I attempted this: SysTriggerEEstop #Stop Dim sumof as Single Dim i as Integer Dim tmp as Single Dim wt as Single Dim lsma_ma as Single #Param "RPeriod" ,30,1,60 #Param "LSMA_Period" ,20,2,60 sumof = 0 For i = 0 To (RPeriod-1) tmp = ((RPeriod-i) - ((RPeriod+1)/3))*Close sumof = sumof + tmp Next wt = sumof*6/(Rperiod*(Rperiod+1)) lsma_ma = wt[1] + (wt-wt[1])*2/(LSMA_Period+1) If wt[1] < lsma_ma[1] and wt > lsma_ma Then Signal = LongSignal ElseIf wt[1] > lsma_ma[1] and wt < lsma_ma Then Signal = ExitSignal If wt[1] > lsma_ma[1] and wt > lsma_ma Then Signal = ShortSignal ElseIf wt[1] < lsma_ma[1] and wt < lsma_ma Then Signal = ExitSignal End If Clearly, neither work -- and I am at a loss.. I tried copying and pasting using other stops.. and filling in the gaps.. ****I even tried using my zScoreMA as a Stop..(As often when the indicator ZERO line is crossed, signifies a trend change in direction at same time with SysTriggerLine .. couldn't do that either).. Thanks if anyone can point me in the right direction. Marc [Edited by julesrulesny on 12/29/2014 11:20 PM] ![]() ![]() ![]() ![]() |