NexusFi: Find Your Edge


Home Menu

 



Categories Help    






The Elite Circle
File sharing for Elite Members only, includes any and all platforms and file types


Entries
Strategy Framework 4 *
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 
 
Suggest other entries I might like
Details: Strategy Framework
Category: The Elite Circle 


September 19th, 2011
Size: 47.60 KB
 


 
Category
 




© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top