Page 1 of 1

Autotrading Entry End of Bar, Profit Target Intrabar- ???

Posted: 22 Jan 2013
by sptrader
I was testing a simple autotrading system today on the ES and ran into this problem (or senior moment).
For example (5 minute bars)...
I enter long 2 contracts NEXT BAR AT MARKET of the 5 minute bar and want to set the 1st profit target at $200 and the second target at $400 , how can I set profit targets INTRABAR ???
Everything I've read (EL GUIDE, etc), either uses IOG (I can't use, because I enter the Close of the bar NOT intrabar) or setprofittarget (it closes ALL (BOTH) contracts. I need to close them separately at different prices)..
I could see maybe a GV from a second chart with the system applied, but there has to be an easier way..(and I think the GV will wait 1 bar to send the value anyway)..
Today, running autotrade), my 1st target was $200 and price went to $300 and still did NOT take profit ! (when the bar closed it took profit)..
I used something like "if mp = 1 and openposiionprofit >= 200 then sell next bar at market"..
I have to exit intrabar.
help !!!

Re: Autotrading Entry End of Bar, Profit Target Intrabar- ??

Posted: 22 Jan 2013
by TJ
I was testing a simple autotrading system today on the ES and ran into this problem (or senior moment).
For example (5 minute bars)...
I enter long 2 contracts NEXT BAR AT MARKET of the 5 minute bar and want to set the 1st profit target at $200 and the second target at $400 , how can I set profit targets INTRABAR ???
Everything I've read (EL GUIDE, etc), either uses IOG (I can't use, because I enter the Close of the bar NOT intrabar) or setprofittarget (it closes ALL (BOTH) contracts. I need to close them separately at different prices)..
I could see maybe a GV from a second chart with the system applied, but there has to be an easier way..(and I think the GV will wait 1 bar to send the value anyway)..
Today, running autotrade), my 1st target was $200 and price went to $300 and still did NOT take profit ! (when the bar closed it took profit)..
I used something like "if mp = 1 and openposiionprofit >= 200 then sell next bar at market"..
I have to exit intrabar.
help !!!
The buzzword is "scaling".
It is a complicated process. I won't attempt to explain it in 50 paragraphs.
If I were you, I would use the KISS principle for now. I don't want to discourage you, but merely want to set you up with a realistic expectation: Programming a scaling in/out autotrade is a major undertaking, it will take a lot of time and effort.

Re: Autotrading Entry End of Bar, Profit Target Intrabar- ??

Posted: 22 Jan 2013
by sptrader
I was testing a simple autotrading system today on the ES and ran into this problem (or senior moment).
For example (5 minute bars)...
I enter long 2 contracts NEXT BAR AT MARKET of the 5 minute bar and want to set the 1st profit target at $200 and the second target at $400 , how can I set profit targets INTRABAR ???
Everything I've read (EL GUIDE, etc), either uses IOG (I can't use, because I enter the Close of the bar NOT intrabar) or setprofittarget (it closes ALL (BOTH) contracts. I need to close them separately at different prices)..
I could see maybe a GV from a second chart with the system applied, but there has to be an easier way..(and I think the GV will wait 1 bar to send the value anyway)..
Today, running autotrade), my 1st target was $200 and price went to $300 and still did NOT take profit ! (when the bar closed it took profit)..
I used something like "if mp = 1 and openposiionprofit >= 200 then sell next bar at market"..
I have to exit intrabar.
help !!!
The buzzword is "scaling".
It is a complicated process. I won't attempt to explain it in 50 paragraphs.
If I were you, I would use the KISS principle for now. I don't want to discourage you, but merely want to set you up with a realistic expectation: Programming a scaling in/out autotrade is a major undertaking, it will take a lot of time and effort.
***********************************************************************
** Thanks TJ, you're the expert, so for now I'll just KISS it..

Re: Autotrading Entry End of Bar, Profit Target Intrabar- ??

Posted: 22 Jan 2013
by TJ
For intrabar profit exits (the whole lot, IOG not required), you can use the keyword SETPROFITTARGET.


ps. if you do a search here, you will find people have made various attempts on scaling in/out autotrades. I do not know their outcome, but you can look at their codes.