Tradecision Talks
May 21, 2013, 06:08:03 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to create a custom Stop Loss that returns a numeric value for the stop?  (Read 5171 times)
oakshadows
Newbie
*
Posts: 3


« on: May 31, 2007, 08:25:24 PM »

Under the tab "Properties" for a new Strategy,  I checked "Additional rules available" to enable me to write my own Stop Loss rules.

I can write (return) a "condition" for the Stop Loss Long.  For example purposes only, the following "condition" code works:  Return low\1\>low\2\;

But, how do I write (return) a "numeric value" for the Stop Loss Long to exit the long position once the Stop Loss price is hit?  For example purposes only, the following "numeric value" code does not work:  Return low\1\;

Thanks.
 
Logged
Tradecision Support Team
Hero Member
*****
Posts: 336


« Reply #1 on: June 01, 2007, 03:27:19 AM »

oakshadows, welcome to the forum!

If you'd like “Stop Loss Long to exit the long position once the Stop Loss price is hit”, you just need to write something like this:
return Open()=15;
In this case, the Stop Loss condition is executed in reaching the value and so an exit from the long position will take place.
Logged
oakshadows
Newbie
*
Posts: 3


« Reply #2 on: June 01, 2007, 09:50:26 AM »

Thanks.

Your example for a numeric Stop Loss Long:  Return Open()=15;

In your example, if the Open of the bar is 18 and the market trades down to 15 later within that same bar, will the long trade exit at that time (ie, later within that same bar once 15 is hit)?
Logged
AlexG
Sr. Member
****
Posts: 16


« Reply #3 on: June 01, 2007, 10:51:36 AM »

oakshadows,

As I see it was just an example. You can use any value, say Close, <, >, etc. Maybe you could provide a liitle bit more detail on what you're trying to accomplish?
Logged
oakshadows
Newbie
*
Posts: 3


« Reply #4 on: June 01, 2007, 11:42:43 AM »


Going back to my original question:  How do I write (return) a "numeric value" for the Stop Loss Long to exit the long position once the Stop Loss price is hit?

Using the thread above, if the market is currently trading at 18 and I want to set my Stop Loss Long to 15, how do I write the code in the "Stop Loss Long" such that anytime the market trades down to 15 I will exit my long position?

Thanks.
Logged
Tradecision Support Team
Hero Member
*****
Posts: 336


« Reply #5 on: June 04, 2007, 03:33:56 AM »

Low <=15;
Logged
AlexG
Sr. Member
****
Posts: 16


« Reply #6 on: June 05, 2007, 06:03:10 AM »

The price value which will be shown in the simulation for the given order can be configured using the strategy settings. In the Trade Price area of your strategy, the Next Bar Open option is set by default. You can select Current Bar Close or Specified. As the simulation process is performed on already formed (known) bars (unlike the Direct Trade Execution mode in which RT data is coming through to the program from the market), and these bars consists of O, H, L, C, volume, therefore we allow selecting from these 4 prices plus the difference between High and Open - MidPrice.

As we understand, you would like the rule to be executed on the same bar where the Stop Loss Long rule is executed and at a Low price. For this you need Strategy Builder > Select a strategy > Properties > Trade Price > Specified: Bars Delay 0 / Buy Low / Sell Low.

Note: In the Direct Trade Execution mode the exit price can differ from the price in time of executing the Stop Loss rule caused by some delays in order processing by a broker.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!