OmniTrader Forum OmniTrader 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.


Only Forum Moderators, Administrators, and the owner of this message may delete it.

 
kmcintyre

Legend
100100100100
Posts: 410

Joined: 8/30/2007
Location: Valley Center, CA

User Profile
 
Subject : RE: I'm confused - help!
Posted : 7/5/2018 5:45 PM
Post #44951 - In reply to #44949

I think I'm saying the same thing in all my posts

LLV(2) returned the lowest low from L[0], L[1], and L[2]. This is absolutely not what I expected, but a PlotPrice() of the value returned from LLv(2) visually confirmed that result.

I had to use LLV(1) to get the lowest low value between the current bar (L[0] if you will) and L[1].

Here's the code I am using...

#stop

' implements Steve Primo's Strategy #4 stop loss

#Param "Cushion", 0.10 ' 10 cents below LLV(1) or above HHV(1)

Dim sLevel as Single

if Signal = LongSignal then
if sLevel = 0 then ' first call - uninitialized
sLevel = LLV(1) - Cushion
end if

if L <= sLevel then
Signal = ExitSignal
end if
else if Signal = ShortSignal then
if sLevel = 0 then ' first call - uninitialized
sLevel = HHV(1) + Cushion
end if

if H >= sLevel then
Signal = ExitSignal
end if
end if

PlotPrice("Primo4SL", sLevel, Black, 1 )


Deleting message 44951 : RE: I'm confused - help!


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