Owner/Admin
Posts: 3925
Location: USA: GA, Lawrenceville | Nirvana's "canned" Fixed-Loss stop is used in a huge number of strategies, as a "backup" in the event that other, fancier or tighter "virtual" stops fail to meet the needs. Sometimes those other stops don't kick-in until a profit-threshold is reached (gray dashed lines). It's important to ALWAYS have a Fixed-Loss stop active ... usually as a Stop-Market Broker order ... to play it safe.
The code shown below duplicates the functionality of the standard FL stop, and adds one extra option ... you can base the "reference price" for the initial stop on the "Guts" pricepoint of the Signal bar (not just the Close or the extreme). Guts is a representative price for the entire bar ... I use it very widely ... better IMHO than the "typical" price. Guts = (H+L+O+O+C+C)/6.
The main purpose of providing this code is to help you learn how to write other Stops, with various options controlled by input parameters. This stop not only plots the exit threshold line, but also plots a small magenta dash between the Signal bar and the Entry bar, showing where the selected Reference price lies.
The stop can be used with a virtual Stop-Market order, since ExitLevel is set ... or it can be used with a Market or MOO or MOC or BOO order, since it fires ExitSignal when the threshold is violated. It works equally well for EOD or RT feeds.
The final attached TXT file has the code - copy to C:\Program Files\Nirvana\OT2011\VBA\Stops
If you are a (paying) TradeTight Member, click here to check out an enhanced version of this stop, which allows you to dynamically utilize different Gap-calculation methods on different trades.
(aJDstFxdLoss - chart & settings.png)
(aJDstFxdLoss - codesnap.png)
Attachments aJDstFxdLoss - chart & settings.png (76KB - 7 downloads) aJDstFxdLoss - codesnap.png (36KB - 7 downloads) aJDstFxdLoss.txt (2KB - 56 downloads)
|
Owner/Admin
Posts: 3925
Location: USA: GA, Lawrenceville | Here is a companion version of the stop, aJDstNirvFxdLoss, that does not have any extra bells and whistles, but just duplicates Nirvana's canned stop. Not quite as fancy as the version posted initially in this thread, but for "purists", here ya go ...
(aJDstNirvFxdLoss - codesnap.png)
Attachments aJDstNirvFxdLoss - codesnap.png (39KB - 8 downloads) aJDstNirvFxdLoss.txt (2KB - 42 downloads)
|