Click here to Login





                                                   Trading System Target Profit and Loss prices

  1

0
Scott Strobeck
2012-10-23 17:17:51


Hi,

When my trading system makes a decision to buy, I want to be able to set target profit stop (limit order) and stop-loss prices based on the conditions at the time of the purchase? I haven't been able to make this work.

For example:
Buy at open Tomorrow, then sell using profit targets and stop loss:
Buy1 = (close > ref(close,1)*1.1);
Buy2 = (volume > 100000);
Buy3 = (close > 1);
buy = (Buy1) && (Buy2) && (Buy3);
ProfitTarget = ((close - ref(close,1))/ref(close,1))*close <--- I only want this evaluated when the buy trigger is made, not daily
StopLoss = ref(low,1); <--- I only want this evaluated when the buy trigger is made, not daily
SellPrice(StopLoss, ProfitTarget, -1);

When I use something similar to above, positions open, but never close. Is there a way to set specific OCO sell limit and stop orders?

Thanks!
Scott



QuantShare
2012-10-23 18:08:41

  0

Best Answer
Here is how to specify a stop based on a custom formula:
http://www.quantshare.com/how-283-how-to-create-a-volatility-based-stop-dynamic-stop-based-on-the-average-true-range

To do it with the formula editor, type:
SetSimStop(_StopProfit, _Point, 5, 0); // $5 profit target

You can specify stop orders:
SetSimTiming(_Buy, _Stop, 0);
BuyPrice([Stop Value], 5);

Or stop limit orders:
SetSimTiming(_Buy, _StopLimit, 0);
BuyPrice([Stop Value], [Limit Value], 5);




Scott Strobeck
2013-01-28 16:34:51

  0

Hi. . . Thanks for the reply. I'm coming back around to work on this again, and am still having trouble.

I don't want a constant, nor do I want a dynamic sell price. I want something in between the two. . . I want loss and profit stop prices calculated when entering the position, based on a formula. I want to use those same values until the position exits.

Thank you in advance!



QuantShare
2013-01-28 17:02:53

  0

You can set any formula in place of "5" in "SetSimStop".




Andreas Herrmann
2017-04-02 03:38:53

  0

I have a similar problem like the original post. I want to set a StopLoss to the "Low" of the purchase day. This can NOT be defined by a fixed, percent or indicator rule. Because NONE of those give me the "Low" of the purchase day. Thank you for any help.


No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Design and backtest a trading system with two strategies
Optimizable Fibonacci Long and Short Trading System
MAE and MFE of a Trading System
Entry Price and Exit Price in Trading System Report
Adaptive Trading System - Minimum Percent Winners and Percent Inv...

How-to Lessons
How to optimize the stop limit of a trading system
How to optimize an indicator in your trading system
How to debug a trading system using the money management tool
How to optimize the number of positions in a trading system
How to set order type of a trading system programmatically

Related Forum Threads
Stop Loss for Intraday Trading System
Profit loss protection trailing stop line on chart .
Add a trading system to the price volume chart
Ranking System with Trading System Help, Revisited
Trading System time period not including start day

Blog Posts
Trading System Analysis: Backtesting report and custom measures
How to combine long, short and custom portfolio strategies within...
How to build and backtest a robust stock trading system
Inverse Fisher Transform: Indicator, composite and trading system
3 ways to rank stocks in a trading system - Simulator and Potfoli...









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.