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.


This message cannot be deleted. It is the first message of the thread.
Administrators or moderators may choose to delete the entire thread


 
Diamondjag

Legend
100100100100
Posts: 404

Joined: 3/12/2006
Location: Brighton, Colorado

User Profile
 
Subject : Help with Programming Stops
Posted : 6/7/2018 10:48 PM
Post #30064

My local investing club put together their “ideal” system and I agreed to program it and run it in OmniTrader to see how it does. They have so many filters in it that it hardly ever trades. Clearly it will be a terrible system but I want to run it for them. I’ve programmed all except the stops. They have three stops and a profit target. I’m not really a programmer and a couple of stops I’m especially having trouble with. I would think all should be fairly easy for a real programmer:

They want a stop ATR(5) X 1.65 below the entry. I’ve programmed:

Stop 1:

If Signal = LongSignal And Entryprice-(ATR(5)*1.67) < Entryprice then
Signal = ExitSignal

ElseIf Signal = ShortSignal And Entryprice+(ATR(5)*1.67) > Entryprice then
Signal = ExitSignal

End If

Doesn’t seem to work. I have no stops in my Omni language files that I can use as an example that deal with stops from the entry price. Any help would be appreciated.

Stop 2:

2% below the Lowest Low of the past 5 days. I’ve programmed:

If Signal = LongSignal And C < (LLV(5)-(LLV(5)*.02))[1] then
Signal = ExitSignal

ElseIf Signal = ShortSignal And C > (HHV(5)+(HHV(5)*.02))[1] then
Signal = ExitSignal

End If

Stop 3:

And the final stop is a close that crosses a Parabolic SAR. I’ve programmed:

If Signal = LongSignal And C[1] > SAR(0.02,0.2) and C < SAR(0.02,0.2) then
Signal = ExitSignal

ElseIf Signal = ShortSignal And C[1] < SAR(0.02,0.2) and C > SAR(0.02,0.2) then
Signal = ExitSignal

End If


PProfit Target:

Finally, they have a profit target that I haven’t even tackled….

Profit Target - 2 times (the entry price minus the initial stop loss price).

Any help on these would be greatly appreciated.

Thanks


[Edited by Diamondjag on 6/7/2018 10:50 PM]

Deleting message 30064 : Help with Programming Stops


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