/////////////////// strategy file ////////////////////////
public class myStrategy : Strategy
{
......
// class declaration - see below
.......
protected override void Initialize() {
.......
trade = new Trade( 10, true );
}
protected override void OnBarUpdate() {
.............
trade.placeOrder( 1, this );
}
}
/////////////////// class declaration //////////////////////////
private class Trade : Strategy {
.............
public placeOrder( int amount, myStrategy that ) {
that.EnterLong( amount, "myTrade" );
// "that" references the host strategy class here
}
}
}
I forgot to mention, other methods from this class are working fine in the same context.
Comment