Yes, that is correct - there is a difference in order quantities. It is one of the issues that arises when I connect to IB account.
Below are script extracts with Profit target, Stop loss, and entry order logic (Calculate = OnEachTick). It is just to show how and when I submit orders.
protected override void OnStateChange()
{
else if (State == State.Configure)
{
// Creation of data series
AddDataSeries(Data.BarsPeriodType.Minute, 5);
AddDataSeries(Data.BarsPeriodType.Minute, 30);
AddDataSeries(Data.BarsPeriodType.Day, 1);
if (BarsInProgress == 0)
{
// Profit Target and Stop loss definition
SetProfitTarget(CalculationMode.Currency, xxxx);
SetTrailStop(CalculationMode.Percent, 0.07);
protected override void OnBarUpdate()
{
// Stop if we don't have enough bars
if (CurrentBars[0] < 1 || CurrentBars[1] < 2 || CurrentBars[2] < 13 || CurrentBars[3] < daysToCalcAvg)
return;
if (BarsInProgress != 0)
return;
EnterLongLimit(1, false, Convert.ToInt32(MyQuantity), GetCurrentAsk(0), "");
I tried to move Set methods to OnBarUpdate section - it did not help.
Comment