- ago
Hi, is there any function in the building block to implement Exits based on Risk Reward ratio.

For example, when the buy signal is trigger, when want to execute a trade as follows:
1). Issue a Buy order
2) For any open LONG position, want to implement the One Cancel Other order as follows:
2a) STOP SELL order with the stop price == most recent local LOW.
2b) SELL LIMIT order with the target price = 1.5 * (Entry Price - Stop Loss Price)

Any suggestions?
0
226
Solved
4 Replies

Reply

Bookmark

Sort
Cone8
 ( 21.65% )
- ago
#1
Blocks implement OCO automatically.

For the backtest, if both orders could be filled on the same bar, you specify the priority as random, optimistic, or pessimitic in Preferences > Backtest > Other Settings > Exit Prioritization

2a) STOP SELL order with the stop price == most recent local LOW.
Drag in a Sell at Limit or Stop, select Stop, 0% Below [Indicator] Low.

2b) SELL LIMIT order with the target price = 1.5 * (Entry Price - Stop Loss Price)
I could be wrong, but I don't think there's block that would get you this operation, so you'll have to resort to C# Code. Drag in a Sell at Limit or Stop block, select Limit.

Now click Open as C# Coded Strategy and find this statement:
CODE:
ClosePosition(foundPosition0, OrderType.Limit, + val2, "Sell at Limit 0% above Highest(High,20)");

Change it to this:
CODE:
ClosePosition(foundPosition0, OrderType.Limit, foundPosition0.EntryPrice + 1.5 * (foundPosition0.EntryPrice - bars.Low[idx]), "Sell at Limit");

Save the C# Strategy. You won't be able to modify this in the blocks now.
0
- ago
#2
I do know that everything is possible in C# code. I am exploring whether the implementation of Risk:Reward exit is possible in Building Block module.

For the STOP price, the % above or below an indicator (e.g., HIGHEST or LOWEST) is not what I am looking for. For example, for SHORT open positions, I want to use the most recent local HIGH (where price turns down) of the Entry Bar. Currently, I wrote customer indicators (e.g, recentHigh or recentLow) and I can use these as STOP price in building block (using the Sell or cover at LIMIT or STOP conditions).

From your reply, it looks like Building Block (without resorting to C# codes) is incapable to specifying a target price based on existing functionalities.

Perhaps, I would like to the development team to explore whether the following functionalities could be exposed in the BUILDING BLOCK:
1) Exposure of Entry Price for use in Building Block
2) Allow the use of simple function for specification of target or stop loss price (e.g, A = B X (C - d))

0
Cone8
 ( 21.65% )
- ago
#3
QUOTE:
I do know that everything is possible in C# code. I am exploring whether the implementation of Risk:Reward exit is possible in Building Block module.
Blocks are C# Code too, as you can see when you click the button. Probably just about anything is possible in Blocks too if we make it possible, but it's not practical to create a block for every conceivable permutation of every variable in the universe.

QUOTE:
For the STOP price, the % above or below an indicator (e.g., HIGHEST or LOWEST) is not what I am looking for.
And I did NOT give you that solution. I gave you a place to start with blocks and modified it precisely to your specification!

QUOTE:
From your reply, it looks like Building Block (without resorting to C# codes) is incapable to specifying a target price based on existing functionalities.
That's wrong. There are a lot of blocks that do that (for example, PowerPack Exits). There just isn't one (that I'm aware of) that can perform the exact calculation you specified, which again, I gave you in C# Code.

QUOTE:
Perhaps, I would like to the development team to explore whether the following functionalities could be exposed in the BUILDING BLOCK:
Sure we can make that a feature request.
1
Best Answer
Glitch8
 ( 15.20% )
- ago
#4
We can also create custom Blocks for your specific needs if you want to use our paid Concierge Support service.
0

Reply

Bookmark

Sort