Click here to Login





                                                   Interpretation of " DRAWDOWNEQ" function

  0

0
F Mazandarany
2010-12-20 15:00:57


I'm using drawdowneq(buy,close)<-5 function in a sell rule as follows using the Simulator(Long only) and ILF as the symbol from 3/1/2004; and I have no MM script to interfere. My interpretation of this sell rule is that when the closing price is lower than the maximum price( since position entry) by more than 5%, the position should be closed.
The simulation results are not consistent with this interpretation. The real question is what exactly does the "drawdowneq" function do as I used it?




// Buy rules

Rule1 = close>sma(200)*1.035;
buy = Rule1;

// Sell rules
Rule2 = drawdowneq(buy,close)<-5;
sell = Rule2;



QuantShare
2010-12-21 04:32:37

  0

Best Answer
The function calculates the drawdown for each bar starting from the last buy signal.

If you plot the buy rule in a chart you will notice that it generates a lot of signals. So, in reality your above formula will not get drawdown since position entry.
To fix this, you can use "RemoveSameSignal" function or change ">" with "cross".

Rule1 = cross(close, sma(200)*1.035);
Rule1 = RemoveSameSignals(close>sma(200)*1.035);

Plot the formulas on a chart to see the difference.



F Mazandarany
2010-12-21 13:20:08

  0

Thank you.


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
News parser function
Advanced Quotes and Custom Databases Function
Swing Point Function (SP)
NORMDIST - Normal Probability Density Function
Day of week and Week number function

How-to Lessons
How to display two stocks on the same chart
How to detect stocks trading near all time highs
How to plot arrows below/above candlesticks on a chart
How to display the bar index of a stock on a chart
How to hide a trading indicator from a particular time frame

Related Forum Threads
Calling a Function from another Function
Question on Swing Point function sp()
Function Call
sp() function
Logging the Comp() function

Blog Posts
How to create market indicators using the composite function - Pa...
The 'inside period' function
How to create market indicators using the composite function - Pa...
How to create market indicators using the composite function - Pa...
Compare stocks and securities by creating a relative performance ...









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.