Click here to Login








Return per Bar Stop - Money Management Strategy

by QuantShare, 4797 days ago
Share |






Return per bar is a metric calculated by dividing a position return by the number of bars since entry (holding period).

For each position and for each trading bar, this money management script calculates the Return par bar and then exits a position if this metric is lower than a specific threshold.

The money management script creates a sort a stop where each position that have a low return per bar is exited to allow new positions to be entered (long or short). The return per bar threshold can be set in the money management variables panel. You can also set a variable named "Bars to skip". This variable instructs the simulator/backtester to ignore the calculation of the Return/Bar stop during the first holding bars of a position.

Both "Return/Bar Stop" and "Bars to Skip" variables can be optimized directly within the money management variables panel.

The Return/Bar Stop can be added along with other stops such as N-Bar Stop, Trailing Stop, Profit Stop or Stop-Loss.

The way this stop works is very simple. First, it creates two numeric inputs in the "OnStartSimulation" event of the money management tool. In the "OnEndPeriod", it gets the value of the latter numeric inputs and then gets all open positions. It loops through each position and checks whether the position holding bars (BarsSinceEntry) is higher than the "Bars to Skip" variable. If it is the case, it calculates the Return/Bar metric and then checks the value against the "Return/Bar Stop" threshold. If the latter condition is met then the position is closed using the "ClosePosition" function.

Other useful money management script:
Hedge a portfolio strategy


Share This ->
Share |


You have to log in to bookmark this object
What is this?




Type: Advanced Money Management

Object ID: 919


Country:
All

Market: All

Style:
All

Reviews
You must log in first

Join now
and get instant access for free to the trading software, the Sharing server and the Social network website.
Click here


Related objects

Empty

Number of reviews
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object

Technical Analysis


Fundamental Analysis



Random Blog Posts

Download Trading Data using the Pre-Script

Download Trading Data using the URL-Script

Trading Items: Data Download using .Net Scripts

Adding Trading Indicators and Formulas to a Chart

How to Download and Use Fundamental Data

QuantShare Version 2.1.2 - Trading Software

Automated Parsing in QS Trading Software

How to Create a List of Ticker Symbols

Show All

Number of reviews
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object






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.