This is a trading item or a component that was created using QuantShare by one of our members.
This item can be downloaded and used by QuantShare Trading Software.
Trading items are of different types. There are data downloaders, trading indicators, trading systems, watchlists, composites/indices...
You can use this item and hundreds of others for free by downloading QuantShare.
Top Reasons Why You Should Use QuantShare:
Works with US and international markets (stock, forex, options, futures, ETF...)
Offers you the tools that will help you become a profitable trader
Allows you to implement any trading ideas
Exchange items and ideas with other QuantShare users
Our support team is very responsive and will answer any of your questions
We will implement any features you suggest
Very low price and much more features than the majority of other trading software
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.
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.