minimize messaging traffic with IB from my signals  [SOLVED]

Questions about MultiCharts and user contributed studies.
ecarlino
Posts: 17
Joined: 02 Feb 2012
Has thanked: 3 times
Been thanked: 1 time

minimize messaging traffic with IB from my signals

Postby ecarlino » 19 Dec 2015

i have 2 questions regarding signals automatically executing on IB via the TWS API:

1. does Mulitcharts format the price based on the settings in QuoteManager for the symbol to ensure that the price is 'valid' with respect to min tic size and price format of the instrument?

--> or, do i need to take care to format each price and make sure it is rounded to minticsize ?

2. i have numerous exit signal - various conditions that would trigger scaling out or getting flat, both on the profit side (limit orders) and downside (stop orders),

--> does Multicharts look at these and only send the 'closest' orders (e.g. 1 stop and 1 limit) at any given time, or are all of the orders being sent over the wire to IB ?

--> if my concern is to not overload IB with too much network/messaging traffic, do i need to manage that within my strategy to only be sending 1 limit and 1 stop at a time? in other words, consolidate all of the code into 1 line for issuing a exit limit (if long) to be sell at minlist(several prices) ?

thank you.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: minimize messaging traffic with IB from my signals

Postby TJ » 19 Dec 2015

i have 2 questions regarding signals automatically executing on IB via the TWS API:

1. does Mulitcharts format the price based on the settings in QuoteManager for the symbol to ensure that the price is 'valid' with respect to min tic size and price format of the instrument?

--> or, do i need to take care to format each price and make sure it is rounded to minticsize ?
::
thank you.

MultiCharts saves the quotes from your dataprovider "as is".

The presentation on your chart (eg tick size) depends on 2 settings in your QuoteManager:

PriceScale
MinMove

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: minimize messaging traffic with IB from my signals

Postby TJ » 19 Dec 2015

i have 2 questions regarding signals automatically executing on IB via the TWS API:
::
2. i have numerous exit signal - various conditions that would trigger scaling out or getting flat, both on the profit side (limit orders) and downside (stop orders),

--> does Multicharts look at these and only send the 'closest' orders (e.g. 1 stop and 1 limit) at any given time, or are all of the orders being sent over the wire to IB ?

--> if my concern is to not overload IB with too much network/messaging traffic, do i need to manage that within my strategy to only be sending 1 limit and 1 stop at a time? in other words, consolidate all of the code into 1 line for issuing a exit limit (if long) to be sell at minlist(several prices) ?

thank you.
MultiCharts is dumb. It will only do things you instruct it to do.

ie. if the logic in your strategy meets the market condition, your order will be sent. If the logic is not met, nothing happens.

ie. you have to code the detail in the strategy to make MC operate the way you want it to.


If you are new to programming, this is a good place to start:
[FAQ] EasyLanguage / PowerLanguage
viewtopic.php?f=16&t=6929

ecarlino
Posts: 17
Joined: 02 Feb 2012
Has thanked: 3 times
Been thanked: 1 time

Re: minimize messaging traffic with IB from my signals

Postby ecarlino » 19 Dec 2015

i have 2 questions regarding signals automatically executing on IB via the TWS API:
::
2. i have numerous exit signal - various conditions that would trigger scaling out or getting flat, both on the profit side (limit orders) and downside (stop orders),

--> does Multicharts look at these and only send the 'closest' orders (e.g. 1 stop and 1 limit) at any given time, or are all of the orders being sent over the wire to IB ?

--> if my concern is to not overload IB with too much network/messaging traffic, do i need to manage that within my strategy to only be sending 1 limit and 1 stop at a time? in other words, consolidate all of the code into 1 line for issuing a exit limit (if long) to be sell at minlist(several prices) ?

thank you.
MultiCharts is dumb. It will only do things you instruct it to do.

ie. if the logic in your strategy meets the market condition, your order will be sent. If the logic is not met, nothing happens.

ie. you have to code the detail in the strategy to make MC operate the way you want it to.


If you are new to programming, this is a good place to start:
[FAQ] EasyLanguage / PowerLanguage
viewtopic.php?f=16&t=6929
thanks for your reply - i am not trying to do anything on the chart, but here is a specific example:

if i am long ESH6 (e-mini) and want to have a stop 1 average-true-range below my entry, i can write an order that says:

if(marketposition = 1) then sell("LX") 1 contract next bar at entryPrice - avgTrRange stop;

but what if that results in a price such as 1990.71
and the e-mini only trades on 0.25 increments - do i need to round that or does MC do that automatically?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: minimize messaging traffic with IB from my signals

Postby TJ » 19 Dec 2015

thanks for your reply - i am not trying to do anything on the chart, but here is a specific example:

if i am long ESH6 (e-mini) and want to have a stop 1 average-true-range below my entry, i can write an order that says:

if(marketposition = 1) then sell("LX") 1 contract next bar at entryPrice - avgTrRange stop;

but what if that results in a price such as 1990.71
and the e-mini only trades on 0.25 increments - do i need to round that or does MC do that automatically?
You have to check with your broker.
Some brokers will round up/down to give you best price.
IB will reject your order if the number does not meet the prescribed price format.

[Edit] Correction: MultiCharts will round your order according to the chart instrument price scale.

ecarlino
Posts: 17
Joined: 02 Feb 2012
Has thanked: 3 times
Been thanked: 1 time

Re: minimize messaging traffic with IB from my signals  [SOLVED]

Postby ecarlino » 19 Dec 2015

thanks - i'm just going to use the function Round2Fraction around all of my prices and be done with it - should have coded it that way in the first place.

thanks for your replies, eric.

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: minimize messaging traffic with IB from my signals

Postby tony » 20 Dec 2015

Why not do something like this.

if(marketposition = 1) then AND close < ( entryPrice - avgTrRange stop) then sell ("LX") 1 contract next bar at market;

This way you would not need to round anything.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: minimize messaging traffic with IB from my signals

Postby Henry MultiСharts » 21 Dec 2015

Hi all,

MultiCharts is rounding the order price based on the chart instrument price scale.

ecarlino
Posts: 17
Joined: 02 Feb 2012
Has thanked: 3 times
Been thanked: 1 time

Re: minimize messaging traffic with IB from my signals

Postby ecarlino » 21 Dec 2015

Hi all,

MultiCharts is rounding the order price based on the chart instrument price scale.
thanks for confirming Henry - i was getting errors (orders rejected to IB) b/c i am using DTN iQFEED on the chart (so i can load enough data to prime the pump for my code and then i mapped the IQ chart symbol to the IB execution symbol - but unfortunately the IQFEED instrument was setup incorrectly in QuoteMgr - i fixed that but wanted to make sure that MC does submit based on the chart params.

thanks again, eric.


Return to “MultiCharts”