Click here to Login





                                                   Time stop based on stock performance over set period

Back to threads - Tags: --
  0

0
Glen
2018-01-10 15:44:55


Hi Quantshare team,

I apologise for duplicate entries, I used the incorrect heading for the previous question.

I am trying to implement a time stop that is based on performance. So that if a stock gets to 30 days for example and the performance is less than 5% return it will exit.

When I try and run this I have coded the following under an N-bar stop:

perf(close, 20) < 0.05

This however does not seem to be working even when I change the percentage. Is there a better way to code this sort of time based performance stop?

Thanks very much.

Cheers
G



QuantShare
2018-01-11 03:35:07

  0

Best Answer
Hi Glen,

The trading system formula is evaluated to get signals. At that time, it doesn't know and cannot use variables such Number of bars held.
So using perf(close, 20) will always calculate the performance of the last 20 bars even the next day the stock was bought.

What you are trying to do require a money management script. Here is an example available in the sharing server that you can use and edit to meet your requirements.

Exit Position based on Profitability





Exit Position based on Profitability (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads Notes Report an item

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
Stock Correlation with its Industry - Change over time
Highest and Lowest value over a dynamic period
Average Stock Performance for each U.S Exchange
Stop Trading Based on Your Portfolio Equity Return
Market Rule based on the Crossover Between Stock Close prices and...

How-to Lessons
How to create a volatility-based Stop - Dynamic stop based on the...
How to detect stocks trading near all time highs
How to quickly select stocks based on the last value of a databas...
How to calculate the average of a time series using the money man...
How to plot a stock using different periods in the same chart

Related Forum Threads
Build up a position over a specific time period
STOP/Profit targets based on the indicator value at the time of e...
Chart for 1m bars over a custom time range
How can i download additional data not within the standard time p...
Ranking performance

Blog Posts
6 techniques to improve the performance of your stock trading str...
Backtesting a Strategy Based on Bond and Stock Index ETFs
Fundamental Screen based on Stock price, ROI and Market capitaliz...
Update Chart Layout based on Active Time Frame
4 Market Composite Indicators Based on Industry Data









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.