Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Login to Download
Strategy Framework
This is the 1.0 version of a general framework with exits to use with every kind of strategy. The main idea is that the trade exits, in general, are very simililar, so we can divide, modularize and reuse the exits. The same idea is applied to position sizing and signal tracking (is how your strategy reads the indicators). A small manual is inlcuded, and I believe that this framework can evolute to a real reusable piece of software for almost every strategy. The onExit() method is called to reset and manage the signals, LookForTrade() to open positions, and ManagePositions() to build your own custom exit. Below you can see some example methods. The public are invited to upgrade it.
public class MyStrategy : StrategyFramework {....
protected override void MyInitialize() {
base.Add(RSI(rsiPeriod,3));
base.Add(SMA(10));
base.Add(SMA(20));
}
protected override void LookForTrade() {
if (Close[0] > Open[0])
positionManager.Position1.EnterLong();
}
protected override void UpdateSignals() {
if (CrossAbove(RSI(rsiPeriod, 3).Avg, rsiHigh, 1))
rsiSignal = -1;
if (CrossBelow(RSI(rsiPeriod, 3).Avg, rsiLow, 1))
rsiSignal = 1;
}
protected override void OnExit(object sender, int positionID) {
rsiSignal = 0;
}
regards,
Henry
Category The Elite Circle
991
henry218
Comments/ratings
ejtrader September 22nd, 2011 07:36 PM
No Comment
Trendseek September 29th, 2011 03:57 AM
Thanks for that valuable and competent Work !!!
I am shure, that the usage of that Framework within a Strategie would be very usefull. Unfortunately the last Part of the Documentation is in Spain, and without more examples it's a bit hardly to understand for me. How could I integrate your example in a new NT-Strategy-Code?
I try to implement your example and received an Error
traderpards October 3rd, 2011 09:40 PM
No Comment
Hub Stevens September 18th, 2013 02:40 PM
Great work! Thanks!