Click here to Login





                                                   Drawdown from positions triggered vs positions accepted

  0

0
Kiran
2016-04-24 13:31:51


I wrote a simple EqMM script (below) that rejects positions if the portfolio drawdown exceeds a threshold.
Challenge is the drawdown seems to be calculated on positions accepted vs all positions triggered, so the equity curve never climbs out of the hole.

Is there another variable in MM I can access that calculates drawdown based on positions triggered?


// Reject if Drawdown .. OnNewPositions section
double dd_threshold = (double)Variables.GetVariable("Drawdown");
double drawdown = Portfolio.Drawdown;

if(drawdown < dd_threshold)
{
Divers.Output("Position Rejected: " + NewPosition.Symbol + ", Drawdown=" + drawdown + ", DD threshold=" + dd_threshold);
Functions.RejectPosition();
return;
}



QuantShare
2016-04-25 05:03:02

  0

Drawdown is calculated based on the portfolio equity. The only way to do what you want is to create a trading system without this rule, export the equity curve series, create a new trading system with that rule and use that equity series to calculate drawdown.


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
Money management to Reject Trading Positions Based on their Past ...
Minimum Number of Positions in a Trading System
EURUSD Long Positions Ratio
Holding period return - classifying positions
Average Maximum Drawdown

How-to Lessons
How to dynamically change the number of positions in a portfolio?
How to optimize the number of positions in a trading system
How to quickly add several positions to your portfolio
How to add trades from one portfolio to another one
How to hide a trading indicator from a particular time frame

Related Forum Threads
Detect flat positions
Different Stops for Long/Short Positions
Holding Constant Positions
How to define an alternate asset to buy when no positions are hel...
How to read the number of positions in trading system

Blog Posts
How to Create Custom Metrics for Your Trading Positions
The average maximum drawdown metric
Diversify your portfolio by investing in stocks from various indu...
How to filter quotes data from high and low price spikes
How to Backtest a Strategy from a Chart









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.