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

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

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

Postby sptrader » 22 Jan 2013

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 !!!

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

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

Postby TJ » 22 Jan 2013

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.

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

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

Postby sptrader » 22 Jan 2013

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..

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

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

Postby TJ » 22 Jan 2013

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.


Return to “User Contributed Studies and Indicator Library”