hadrianl / hadrianl/ibapi

Order Conditions not working

Open
#33 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
163
Forks
65
PR merge metrics
No merged PRs in 30d

Description

Hi,

It seems there's a problem with InitOrderCondition, the condition is not being passed upon OrderCondition, so the value is always 0. I tried initializing it with a TimeCondition and a margin condition, but this always crashes the ib client. I also tried to assert it to time condition, but both the asserted and original OrderConditioner doesn't seem to be carrying conType forward and since this variable isn't exported, it's not possible to set it from an outside package.

I did a workaround and created a factory function to solve my problem, but of course, this is not optimal.

```
func NewTimeCondition(time string, isMore bool, isConj bool) TimeCondition {
oc := OrderCondition{
conditionType: 3,
IsConjunctionConnection: isConj,
}
tc := TimeCondition{
OperatorCondition: OperatorCondition{oc, isMore},
Time: time,
}
return tc
}
```

I'm using golang 1.17/MacOS 12.0.1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.