I try to read at 1 hours charts and when it is a sell signal, I would sell immediately (do not wait another hour).
It seems like a simple thing but I can not work. As you know, I am a beginner.
Thanks /NiC
How to... sell immediately
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: How to..
I try to read at 1 hours charts and when it is a sell signal, I would sell immediately (do not wait another hour).
It seems like a simple thing but I can not work. As you know, I am a beginner.
Thanks /NiC
do a search on Intra-bar Order Generation or IntrabarOrderGeneration (IOG).
read:
The essential EasyLanguage programming guide
http://www.tssupport.com/support/tutorials/
Intra-bar Order Generation... pg. 82
more EasyLanguage help here:
http://forum.tssupport.com/viewtopic.php?t=6929
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: Intra-bar order generation
Hi TJ,
I've tried Intra-bar order generation many times and read about it but I do not want it to affect 1 hours worn that create a sell signal, as it does in this case.
I do not understand what you want to do.
You can post your code,
with a flow diagram if necessary, to explain your intention.
Here is an extract from my 10 second bar code.
I will explain it bit by bit. I transmitted too early.
Can you not set your 60 minute bar chart study to execute on every tick and then execute anywhere within the bar.
If I am corrrect, of the commands above the BarStatus=2 could be used to execute on the last tick of the bar. You could also store the time in a previous time field and execute on the first tick of the next bar. Lastly the Mod command above is set up to indicate I have a 10 second bar and the MidBarStall paramter can be used to execute on the 8th second of that bar (if there is a tick on that 8th second that is). So to use the mod command in 60 minute bars I think you just enter a 60 where the 10 is (I THINK!!!). that way you can decide what minute to execute on. You could also just test the time reserve word. Like TJ said, a full read of the manual is a pretty good idea.
I think you can use the FormatTime command as another way to figure out what minute you are at within the hourly bar. Press F1 while in MC and search for it.
I will explain it bit by bit. I transmitted too early.
Code: Select all
if (Replay = 1 and BarStatus = 2)
or
(Mod(SecondsfromDateTime(ComputerDateTime),10) >= MidBarStall) then
begin
End;
If I am corrrect, of the commands above the BarStatus=2 could be used to execute on the last tick of the bar. You could also store the time in a previous time field and execute on the first tick of the next bar. Lastly the Mod command above is set up to indicate I have a 10 second bar and the MidBarStall paramter can be used to execute on the 8th second of that bar (if there is a tick on that 8th second that is). So to use the mod command in 60 minute bars I think you just enter a 60 where the 10 is (I THINK!!!). that way you can decide what minute to execute on. You could also just test the time reserve word. Like TJ said, a full read of the manual is a pretty good idea.
I think you can use the FormatTime command as another way to figure out what minute you are at within the hourly bar. Press F1 while in MC and search for it.
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
One thing to note is there is no "immediate" buy/sell/cover in MC, not even with IOG turned on. At best it's on the next tick update. In virtually all cases this is fine. However, in very quiet markets the next tick update might not occur for several seconds if not minutes. For longer term traders this is not an issue. For very short term or day traders this is often an issue. The only way to overcome this issue now is to write your own immediate order types in a dll using, if available, the broker's api's. IB provides such a library and I have played with them before I started using MC. I lost interest writing my own trading platform once I saw MC's excellent charting capabilities. One day I might write a plug-in dll to do immediate orders but at this stage I'm happy using the IOG approach. It works reasonably well. For example, I execute my "at market" orders only when barstatus = 2, and watch them processed on the next tick update in the next bar.If I set IOG is false, how can I sell/buytocover immediately? Not wait for next bar.
Thanks!
- Bruce DeVault
- Posts: 438
- Joined: 19 Jan 2010
- Location: Washington DC
- Been thanked: 2 times
- Contact:
Unless you are talking about something that is very thinly traded, it's improbable you could get an execution in the marketplace "before the next tick" in real life anyway.
The solution to these types of design conundrums tends to be to have the platform calculate your strategy on a timer basis e.g. once every 1/10 second etc. in addition to every tick.
The solution to these types of design conundrums tends to be to have the platform calculate your strategy on a timer basis e.g. once every 1/10 second etc. in addition to every tick.
That's what I meant. Unless a market is very slow and the trader is interested in true immediate "at market" order placement the same way it can be done through the broker's interface, the current way MC operates is sufficient.Unless you are talking about something that is very thinly traded, it's improbable you could get an execution in the marketplace "before the next tick" in real life anyway.
I did experiment with an idea to feed an ascii text file with real-time tick data from one study, and in parallel have a program output to that file a dummy tick every second, then have a chart associated to that file using ASCII mapping. I didn't get very far so gave up. Not that important for me - just had a bit of fun trying to see if the idea would work.[/quote]The solution to these types of design conundrums tends to be to have the platform calculate your strategy on a timer basis e.g. once every 1/10 second etc. in addition to every tick.
- Bruce DeVault
- Posts: 438
- Joined: 19 Jan 2010
- Location: Washington DC
- Been thanked: 2 times
- Contact: