OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


  Current location        Thread information  
OmniTrader Professional Forum
OmniLanguage Discussion
SysTriggerLine - Reversing Signals(how to?) #STOP
Last Activity 10/5/2024 12:51 AM
5 replies, 4598 viewings

Jump to page : 1
Now viewing page 1 [25 messages per page]
 
back reply
Printer friendly version

^ Top
julesrulesny

Legend
100100100100252525
Posts: 498

Joined: 8/28/2009
Location: NYC

User Profile
 
Subject : SysTriggerLine - Reversing Signals(how to?) #STOP
Posted : 12/29/2014 11:01 PM
Post #23254

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]

Attached file : sysTriggerLine.txt (0KB - 399 downloads)
Attached file : sysTriggerLine2.txt (0KB - 384 downloads)
Attached file : points 1 2 3 4 systrigger.PNG (40KB - 521 downloads)
Attached file : close above SysTrig at A.PNG (13KB - 413 downloads)

^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: SysTriggerLine - Reversing Signals(how to?) #S
Posted : 12/30/2014 12:04 AM
Post #23255 - In reply to #23254

Impossible to do reversing via an OLang stop, or for that matter, with a trade plan. Must use the reversing option of an orders block.
^ Top
julesrulesny

Legend
100100100100252525
Posts: 498

Joined: 8/28/2009
Location: NYC

User Profile
 
Subject : RE: SysTriggerLine - Reversing Signals(how to?) #S
Posted : 12/30/2014 9:22 AM
Post #23256 - In reply to #23255

I did not know that. Thank you.

Can a system such as this be written as a stop??
^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: SysTriggerLine - Reversing Signals(how to?) #S
Posted : 12/30/2014 11:20 AM
Post #23257 - In reply to #23256

You cannot assign LongSignal or ShortSignal in a stop, you can only test them. You can assign ExitSignal in a stop but not in a System.
^ Top
julesrulesny

Legend
100100100100252525
Posts: 498

Joined: 8/28/2009
Location: NYC

User Profile
 
Subject : RE: SysTriggerLine - Reversing Signals(how to?) #S
Posted : 12/31/2014 6:33 PM
Post #23258 - In reply to #23257

Ok.
Not exactly what you mean by "...you can only test them"? If I can't use LongSignal ShortSignal, how is it they can be tested? Do you mean "Debugging"?

Why I'm confused is just b/c I see LongSignal ShortSignal being assigned in other #Stops in OLang? Rather a more appropriate term is they are being used in these Stops? (**Think I recall now discussing this once a long time ago.. a bit of dejavu).

Perhaps, I don't understand the difference of the term "assign" then????


For example: Here's a STOP in OTPRO ...."PEAK STOP"


#Stop ' Defines that this is a stop (required for project folders)

' ***************************************************************************
' * Peak Stop
' * by Hans van der Wal
' *
' * Summary:
' * Stop out of an existing trade if we go a given percent below yesterday's Close
' *
' * Parameters:
' * Percent = percentage value to use.
' *
' * Last Update: November 1, 2005
' ***************************************************************************

#Param "Percent", 1 ' Defines parameter Percent with a default value of 1(%)

' If we have a long signal in the vote line, and
' the close price is at least Percent % (1%) below yesterday's close price
If Signal = LongSignal And (C-C[1])/C[1] < -1* Percent/100 Then
Signal = ExitSignal ' exit the trade

' If we have a short signal in the vote line, and
' the close price is at least Percent % (1%) above yesterday's close price
ElseIf Signal = ShortSignal And (C-C[1])/C[1] > Percent/100 Then
Signal = ExitSignal ' exit the trade
End If


^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: SysTriggerLine - Reversing Signals(how to?) #S
Posted : 12/31/2014 6:49 PM
Post #23259 - In reply to #23258

If you try to do:
Signal = LongSignal
or
Signal = ShortSignal
... in a STOP, as a separate assignment line, it is IGNORED.

But you normally will use one or both of them in a SYSTEM.

The only signal assignment (ie setting) you can do in a STOP is:
Signal = ExitSignal

====

You can "test" the direction of the active trade in a STOP by:
if Signal = LongSignal then ...
or
if Signal = ShortSignal then ...

But you can't change the direction of the signal in a Stop routine ... you can only end the active trade.

===

If you saw Long/ShortSignal "assignments" in OLang STOP routines before, then probably those routines were faulty. You probably are remembering their use in SYSTEM routines.



[Edited by Jim Dean on 12/31/2014 6:51 PM]

Jump to page : 1
Now viewing page 1 [25 messages per page]
back reply

Legend    Action      Notification  
Administrator
Forum Moderator
Registered User
Unregistered User
E-Mail this thread to a friend
Toggle e-mail notification


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.