The strategy uses a method that calls a sequential order of methods in a row, and they all collapse into a bool value at the end allowing me to enter a trade or not.
if (isEligibleForTrade())
{
EnterLong(1, entryOrderName);
}
protected bool isEligibleForTrade()
{
if(method1()) return true
else if (method2()) return true
etc.
return false; // if all failed.
}
protected bool method1()
{
if(stageOne() && StageTwo())
{
return true;
}
return false;
}
My questions are:
1. In the case that i just want to take each method (i.e. method1/x/y/z) and separate them into classes of their own for a cleaner and more modular code, where should i store those classes, and as what? a strategy? an indicator? an addon? all these classes use bar series data, and should be able to support it by default if possible.
2. in the case that it can be done the way i wanted, do i need to add the bar series of the main strategy to those classes? or is the object reference created in the strategy enough?
Any reference to other solutions/ recommended data structures/ documents will be highly appreciated!
Thanks in advance, Aviram Y.

Comment