Autotrading question

Questions about MultiCharts and user contributed studies.
aljafp
Posts: 184
Joined: 28 Oct 2005
Been thanked: 1 time

Autotrading question

Postby aljafp » 27 May 2009

hi,
Since the last time i look at autotrading, MC can only send orders at
1) close of current bar or 2) at next Bar.....

Are there any improvements ?
Can we send market orders immediately once conditions have been met ?
If yes, great.... If no, are there any plans to change.

thanks

SUPER
Posts: 624
Joined: 03 Mar 2007
Has thanked: 99 times
Been thanked: 80 times

Postby SUPER » 28 May 2009

With IOG (intrabarordergeneration) enabled strategies one can issue orders as soon as conditions are met within the bar, so you need not have to wait for close of the bar.

aljafp
Posts: 184
Joined: 28 Oct 2005
Been thanked: 1 time

Postby aljafp » 28 May 2009

With IOG (intrabarordergeneration) enabled strategies one can issue orders as soon as conditions are met within the bar, so you need not have to wait for close of the bar.


that's great.

But i have 1 more question, so what's the command to send orders immediately ?

My understanding of easylanguage is we can only do
Buy 5 Contracts this bar on Close or Buy 5 Contracts next Bar at Market.

Can we now do
Buy 5 Contracts this Bar at Market ?

Is there a user guide lying around ?

Thanks.....

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 28 May 2009

Next Bar at Market command will do what you need in IOG mode since it considers each new tick as a new bar.

aljafp
Posts: 184
Joined: 28 Oct 2005
Been thanked: 1 time

Postby aljafp » 28 May 2009

Next Bar at Market command will do what you need in IOG mode since it considers each new tick as a new bar.



I see... so even though the trade condition is already met, it still waits for NEXT TICK before sending out the market order.

hmm.... i was hoping it would send out immediately once conditions are met. For heavily traded markets like ES, it should be fine.
But for markets like HSI... it could mean quite a bit of slippage.

Any plans to improve this ?

thanks

gregorio123456
Posts: 117
Joined: 08 Nov 2005
Been thanked: 3 times

Postby gregorio123456 » 28 May 2009

Next Bar at Market command will do what you need in IOG mode since it considers each new tick as a new bar.



I see... so even though the trade condition is already met, it still waits for NEXT TICK before sending out the market order.

hmm.... i was hoping it would send out immediately once conditions are met. For heavily traded markets like ES, it should be fine.
But for markets like HSI... it could mean quite a bit of slippage.

Any plans to improve this ?

thanks


try this..... w IOG

if yourcondition=true then buy next bars yourprice limit;

jose

janus
Posts: 755
Joined: 25 May 2009
Has thanked: 41 times
Been thanked: 84 times

Postby janus » 28 May 2009

Next Bar at Market command will do what you need in IOG mode since it considers each new tick as a new bar.


Andrew, unfortunately even that is not good enough. I also need a way to place an "at market" order as soon as a condition is satisfied. Even if nothing changes (bid, ask, trade) I like to have a time based condition (eg, after 2 minutes) that places an "at market order". At the moment I believe this is intrinsically impossible in MC. This is only relevant to periods where market activity is very quiet, which is common during night sessions. The only way I've found to do this is to write my own program in another language that updates a dummy ASCII text file every say 30 seconds, which is mapped to a symbol, to which study is applied. This way, I can check my condition is satisfied every 30 seconds and place a market order as you described. Also, I think this will only work properly if data1 is the actual market to be traded.

What would be a nice new feature to avoid all this is to have a "wake up" option (eg, wake up every n seconds after the previous update or wake up, which ever came last) in MC to run the study regardless of market activity. There should also be another system variable to return True if the study is triggered by this means or False if it was triggered by an update from the market.

aljafp
Posts: 184
Joined: 28 Oct 2005
Been thanked: 1 time

Postby aljafp » 29 May 2009

Next Bar at Market command will do what you need in IOG mode since it considers each new tick as a new bar.



I see... so even though the trade condition is already met, it still waits for NEXT TICK before sending out the market order.

hmm.... i was hoping it would send out immediately once conditions are met. For heavily traded markets like ES, it should be fine.
But for markets like HSI... it could mean quite a bit of slippage.

Any plans to improve this ?

thanks


try this..... w IOG

if yourcondition=true then buy next bars yourprice limit;

jose


What i want is to send a market order without even having to wait for the next tick.

gregorio123456
Posts: 117
Joined: 08 Nov 2005
Been thanked: 3 times

Postby gregorio123456 » 29 May 2009

Next Bar at Market command will do what you need in IOG mode since it considers each new tick as a new bar.



I see... so even though the trade condition is already met, it still waits for NEXT TICK before sending out the market order.

hmm.... i was hoping it would send out immediately once conditions are met. For heavily traded markets like ES, it should be fine.
But for markets like HSI... it could mean quite a bit of slippage.

Any plans to improve this ?

thanks


try this..... w IOG

if yourcondition=true then buy next bars yourprice limit;

jose


What i want is to send a market order without even having to wait for the next tick.


in IOG mode any tick is considered like bar is close on charts for send the order ===» last tick was last tick of bars..... and... future... one new tick come, will be new tick of bar and same time will be the last tick of bar .... when you have yourcondition=true is from last bars or from your history(past) bars.... when come new ticks, the bars is close in mode IOG and if yourcondition is true then MC send one order (limit or market or stop or on close )

and this order wait for next tick ,if fill... ok ....if not fill then MC see if yourcondition is true in last bars or tick or in history of your bars... if true then send again the order

jose

aljafp
Posts: 184
Joined: 28 Oct 2005
Been thanked: 1 time

Postby aljafp » 29 May 2009

Next Bar at Market command will do what you need in IOG mode since it considers each new tick as a new bar.



I see... so even though the trade condition is already met, it still waits for NEXT TICK before sending out the market order.

hmm.... i was hoping it would send out immediately once conditions are met. For heavily traded markets like ES, it should be fine.
But for markets like HSI... it could mean quite a bit of slippage.

Any plans to improve this ?

thanks


try this..... w IOG

if yourcondition=true then buy next bars yourprice limit;

jose


What i want is to send a market order without even having to wait for the next tick.


in IOG mode any tick is considered like bar is close on charts for send the order ===» last tick was last tick of bars..... and... future... one new tick come, will be new tick of bar and same time will be the last tick of bar .... when you have yourcondition=true is from last bars or from your history(past) bars.... when come new ticks, the bars is close in mode IOG and if yourcondition is true then MC send one order (limit or market or stop or on close )

and this order wait for next tick ,if fill... ok ....if not fill then MC see if yourcondition is true in last bars or tick or in history of your bars... if true then send again the order

jose


Jose, you are describing what Andrew has mentioned and i perfectly understand what you are saying.

But apparently you do not understand what i want..

when current tick results in condition=true I want to send a market order out without waiting for next tick to come in.

thanks for your efforts.

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 29 May 2009

All orders are generated for the next bar. This is the way it works.

weitau
Posts: 12
Joined: 24 Jun 2009

Postby weitau » 26 Jun 2009

aljafp,

From what you said, once your code detects a condition, you want to send an order without waiting for the next bar. Jose says that it can be sent as soon as the next tick. Yes, in certain markets, the next tick can be too long. But instead of waiting for the next tick - defined as a trade - why can't you send it based on the bid/ask ticks? Jose or Andrew, can this be done?

Otherwise there are other products out there that have a event-driven architecture.

Hope this helps!

Robert

janus
Posts: 755
Joined: 25 May 2009
Has thanked: 41 times
Been thanked: 84 times

Postby janus » 26 Jun 2009

The market has to be very slow if waiting for the next tick for the order to be placed becomes a problem. However, I do agree it's a silly limitation and should be removed by default. After all, that's what a manual trader does. A live trader doesn't wait for the next tick to place the order, right? In practice though, several ticks may have gone through in a busy market before the live trader has submitted the order. It's probably splitting hairs here but I definitely would prefer it to be as real-time as possible, which is one of the main requirements of an automatic trading system.

bowlesj3
Posts: 2028
Joined: 21 Jul 2007
Has thanked: 174 times
Been thanked: 405 times

Postby bowlesj3 » 27 Jun 2009

I am a discretionary trader and thus prefer to have more control than MC can provide. So I have MC set a GV on a specific second within the 10 second bar which is checked in my database program every second and the database program sends the order to TWS and it turns off the GV. In a fast market this is probably slower than the next tick but in the SXF many times it would be much faster than the next tick. Having said that, of course if the ticks come trough on average every 25 seconds it isn't going to work. Being a discretionary trader I can press the button in my database program to execute an order in TWS when ever I feel like it so nothing here is all that important to me in a way I suppose. I generally use the auto fire to take care of bounce entry and I do the stall manually (as usual using MC as a workload reduction tool only to help reduce my errors).

Regarding Janus's comment
What would be a nice new feature to avoid all this is to have a "wake up" option (eg, wake up every n seconds after the previous update or wake up, which ever came last) in MC to run the study regardless of market activity. There should also be another system variable to return True if the study is triggered by this means or False if it was triggered by an update from the market.

I posted an idea to have the "execute on every tick" option for a study to be enhanced to have 4 check boxes. "execute on every tick, "execute on every bid/ask change" (or maybe even split this) or "execute on every X number of seconds". I figure the location of the current "execute on every tick" checkbox is in my opinion logically the best place for the trader to indicate other methods to have the study executed.

In addition I suggested MC have reserve words which allow the study to detect which of these conditions were present at the time of execution. In other words there may be 2 or 3 present at the same time and the study may need to know this.

Many moons ago I sent an email to Marina requesting MC have an option to check a reserved GV to see if the study should be executed. If this idea was implemented then an additional check box could be included which could be "Execute the check of this GV every X number of seconds.". Maybe that is the better way of the two but only if a trader has a good way to control this GV externally. In other words they know other programming languages other than just EL. I wanted this to allow me to force a recalculate off hours when the live feed was stopped.
Last edited by bowlesj3 on 28 Jun 2009, edited 2 times in total.

bowlesj3
Posts: 2028
Joined: 21 Jul 2007
Has thanked: 174 times
Been thanked: 405 times

Postby bowlesj3 » 28 Jun 2009

Regarding the last reserved GV idea, after giving it some thought, I think it would only work if MC had a reserve word built in for defining the GV so MC knows what GV the user has set up for checking. For example, inside the EL code would be a reserve word command called FakeTickGV. It would be a command to load a memory area with the GV name. Here is what would typically be put in that memory area.

FakeTickGV = Studyname + Symbol

In my case I would need to set up two of them for each study I want to force an execution on (one for each of the two symbols I trade).

So if the study was set up to check this GV (meaning the checkbox mentioned in the above post was turned on) I could externally turn on either of these GVs to force the study to execute for what ever symbol I wanted. Some traders may want the results of one study to cause another study to execute this way.


Return to “MultiCharts”