How to... sell immediately

Questions about MultiCharts and user contributed studies.
NiC72
Posts: 103
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 36 times
Been thanked: 13 times

How to... sell immediately

Postby NiC72 » 24 Feb 2010

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

User avatar
TJ
Posts: 7459
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2138 times

Re: How to..

Postby TJ » 24 Feb 2010

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

NiC72
Posts: 103
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 36 times
Been thanked: 13 times

Intra-bar order generation

Postby NiC72 » 24 Feb 2010

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.

User avatar
TJ
Posts: 7459
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2138 times

Re: Intra-bar order generation

Postby TJ » 24 Feb 2010

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.

bowlesj3
Posts: 2148
Joined: 21 Jul 2007
Has thanked: 210 times
Been thanked: 424 times

Postby bowlesj3 » 24 Feb 2010

Here is an extract from my 10 second bar code.
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;
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.

NiC72
Posts: 103
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 36 times
Been thanked: 13 times

Excellent

Postby NiC72 » 24 Feb 2010

Thanks, the solution was exactly what I needed.
I listen to both of you and read through the Easy Language Guide again.

TW
Posts: 31
Joined: 14 Dec 2009
Has thanked: 5 times
Been thanked: 1 time

Postby TW » 03 Mar 2010

If I set IOG is false, how can I sell/buytocover immediately? Not wait for next bar.

Thanks!

User avatar
TJ
Posts: 7459
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2138 times

Postby TJ » 03 Mar 2010

If I set IOG is false, how can I sell/buytocover immediately? Not wait for next bar.

Thanks!
manually click the buy/sell button on your broker's software.

.

janus
Posts: 802
Joined: 25 May 2009
Has thanked: 46 times
Been thanked: 94 times

Postby janus » 04 Mar 2010

If I set IOG is false, how can I sell/buytocover immediately? Not wait for next bar.
Thanks!
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.

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 04 Mar 2010

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.

janus
Posts: 802
Joined: 25 May 2009
Has thanked: 46 times
Been thanked: 94 times

Postby janus » 04 Mar 2010

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

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 04 Mar 2010

I've added a more specific post about this at http://forum.tssupport.com/viewtopic.php?t=7203.


Return to “MultiCharts”