Page 1 of 1

Session and Autotrade

Posted: 09 Oct 2011
by HummerH1
Hello!

I thought the session was defining the range time for trading.
Meant that there will be not any trade outside of this range.

Here is the doc quote:
Trading sessions are the hours in which a contract is available for trading. The trading session for each contract varies
depending on the contract and the exchange.
Did I understand it wrong?
Because Ive defined range session from 8am to 3pm, but i got trade at 3 am.

Did I miss something? Why isn't it working like this? How can I make it work?

Thanks

Re: Session and Autotrade

Posted: 09 Oct 2011
by TJ
Hello!

I thought the session was defining the range time for trading.
Meant that there will be not any trade outside of this range.

Here is the doc quote:
Trading sessions are the hours in which a contract is available for trading. The trading session for each contract varies
depending on the contract and the exchange.
Did I understand it wrong?
Because Ive defined range session from 8am to 3pm, but i got trade at 3 am.

Did I miss something? Why isn't it working like this? How can I make it work?

Thanks
Where did you define this "range session from 8am to 3pm"?

Re: Session and Autotrade

Posted: 10 Oct 2011
by HummerH1
It's the session I defined for my instrument: CME emini combined

Ive look around a little bit and found that I'd better not to use the ssetexitclose function.
That was the reason of my question. So I won't use that.

But how the session time impact my trades? Does it impact it at all?

Re: Session and Autotrade

Posted: 10 Oct 2011
by TJ
It's the session I defined for my instrument: CME emini combined

Ive look around a little bit and found that I'd better not to use the ssetexitclose function.
That was the reason of my question. So I won't use that.

But how the session time impact my trades? Does it impact it at all?
Strategies read bars on the chart, and based its action on the information of the bars.

ie:
if there are bars on the chart, the strategy will read them, and trade them.

Therefore your default "session" is whatever bars you have on the chart.

Re: Session and Autotrade

Posted: 11 Oct 2011
by HummerH1
I didnt understand what you meant by
Therefore your default "session" is whatever bars you have on the chart.
What the " for? it's not a real session?
Why do I chose a session to my instrument then? It's only so as I can use the sessionxxx varaibles?


I've looking around at posts and at the doc, Im trying to use the

Code: Select all

sessionendtime
and

Code: Select all

sessionfirstbattime
into my trades.
They are 2 parameters:
Sessiontype
sessionnumber

1- what's the difference between regular type or autodetect? it seems to do the same
2- I used the currentsession variable to print and see what are the numbers in my chart.
Ive found out that the session number is increasing for each line defined in the session I chose. Is that right???
In each of these lines, I have a "session end" box which I can check or uncheck.
What is it for??
I thought that if left unchecked the session will continue over the next line and will not end. But not. the session number is increasing anyway.

Re: Session and Autotrade

Posted: 15 Oct 2011
by TJ
MultiCharts collects data 24/7.... irregardless of instrument, number of sessions, or their start/end times.

When you create a chart, you can choose to display a 24 hr chart,
or a chart showing only the default session.
Most people choose RTH as their default session, but it is an option, your choice.

When you apply an autotrade to a chart,
the strategy will read all the data on the chart, irregardless of sessions.
Unless you have specified in your code, the strategy will use all the bars on the chart.
ie.
if your chart have 24 hr of bars, the strategy will trade all 24 hrs of bars.
by the same token,
if your chart have missing bars, the strategy will trade without realizing there are missing bars.

Re: Session and Autotrade

Posted: 17 Oct 2011
by HummerH1
Thanks TJ for your explanation

But you did not answer the questions of my last post...

Re: Session and Autotrade

Posted: 17 Oct 2011
by TJ
Thanks TJ for your explanation

But you did not answer the questions of my last post...
can you supply more information regarding your question?

eg. screenshot, where or how you want to use a specific feature, etc.,

Re: Session and Autotrade

Posted: 17 Oct 2011
by HummerH1
Hello,

I talk about this part of the post:
Im trying to use the
sessionendtime and sessionfirstbattime into my trades.
They have 2 parameters:
Sessiontype
sessionnumber

1- what's the difference between regular type or autodetect? it seems to do the same
2- I used the currentsession variable to print and see what are the numbers in my chart.
Ive found out that the session number is increasing for each line defined in the session I chose. Is that right???
In each of these lines, I have a "session end" box which I can check or uncheck.
What is it for??
I thought that if left unchecked the session will continue over the next line and will not end. But not. the session number is increasing anyway.
I just want to understand how its working, so as I can make better use of it. I have no screenshot to post. and my output file wont tell anything

Re: Session and Autotrade

Posted: 17 Oct 2011
by TJ
Hello,

I talk about this part of the post:
Im trying to use the
sessionendtime and sessionfirstbattime into my trades.
They have 2 parameters:
Sessiontype
sessionnumber

1- what's the difference between regular type or autodetect? it seems to do the same
2- I used the currentsession variable to print and see what are the numbers in my chart.
Ive found out that the session number is increasing for each line defined in the session I chose. Is that right???
In each of these lines, I have a "session end" box which I can check or uncheck.
What is it for??
I thought that if left unchecked the session will continue over the next line and will not end. But not. the session number is increasing anyway.
I just want to understand how its working, so as I can make better use of it. I have no screenshot to post. and my output file wont tell anything
see post #2.

Re: Session and Autotrade

Posted: 03 Nov 2011
by HummerH1
post2?
Ive answered in post3

Re: Session and Autotrade

Posted: 05 Nov 2011
by HummerH1

Code: Select all

print( "test --------" + NumToStr(Time,0) + " " + NumToStr(CurrentSession(0),0));
condition10 =(time>SessionEndTime(0,1)+1 and time[1]<=SessionEndTime(0,1)+1);

if condition10 then
print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
this code got an error in running time, when using a 1 min frame.
STD exception: invalid argument
With 15 mins it does not.

Why? How can I make it work?

Re: Session and Autotrade

Posted: 05 Nov 2011
by HummerH1
This is the definition of the session i use
the error comes on thursday around 17
Last print is "test --------1111103 1645 9"

Re: Session and Autotrade

Posted: 05 Nov 2011
by TJ

Code: Select all

print( "test --------" + NumToStr(Time,0) + " " + NumToStr(CurrentSession(0),0));
condition10 =(time>SessionEndTime(0,1)+1 and time[1]<=SessionEndTime(0,1)+1);

if condition10 then
print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
this code got an error in running time, when using a 1 min frame.
STD exception: invalid argument
With 15 mins it does not.

Why? How can I make it work?
I have tested the code; it runs without problem.

Please copy and paste the whole error message.
Please post a snippet of your print out.
Post a screen shot whenever possible.

Re: Session and Autotrade

Posted: 06 Nov 2011
by HummerH1
screen with the error

Re: Session and Autotrade

Posted: 06 Nov 2011
by HummerH1
the print out;

and again the code in my indicator;

Code: Select all

print( "test --------" +NumToStr(Date,0) +" "+ NumToStr(Time,0) + " " + NumToStr(CurrentSession(1),0) +"/" + NumToStr(sessioncount(1),0) );
condition10 =(time>SessionEndTime(1,1)+1 and time[1]<=SessionEndTime(1,1)+1);

if condition10 then
print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
Ive chose the "cme combined" session in the chart settings.
Ive nothing else in my chart except this indicator.

I ve just tried again now, and I still have the error.

Re: Session and Autotrade

Posted: 06 Nov 2011
by TJ
the print out;

and again the code in my indicator;

Code: Select all

print( "test --------" +NumToStr(Date,0) +" "+ NumToStr(Time,0) + " " + NumToStr(CurrentSession(1),0) +"/" + NumToStr(sessioncount(1),0) );
condition10 =(time>SessionEndTime(1,1)+1 and time[1]<=SessionEndTime(1,1)+1);

if condition10 then
print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
Ive chose the "cme combined" session in the chart settings.
Ive nothing else in my chart except this indicator.

I ve just tried again now, and I still have the error.

this is not the same code as the one you posted above.

Re: Session and Autotrade

Posted: 06 Nov 2011
by HummerH1
here the one before

Code: Select all

//print( "test --------" +NumToStr(Date,0) +" "+ NumToStr(Time,0) + " " + NumToStr(CurrentSession(0),0) +"/" + NumToStr(sessioncount(0),0) );
//condition10 =(time>SessionEndTime(0,1)+1 and time[1]<=SessionEndTime(0,1)+1);
i grayed it to check with 1 if any diff
and i add the total number of sessions

but no diff between the 2 codes
same error at same time

Re: Session and Autotrade

Posted: 06 Nov 2011
by TJ
what is your computer local time?
what is the chart time? local time or exchange time?

if your local time is in a different zone from exchange time,
I would recommend that you set your chart and symbol to exchange time.

Re: Session and Autotrade

Posted: 06 Nov 2011
by HummerH1
Chart and symbol are exchange time

my computer is local time in france

Re: Session and Autotrade

Posted: 07 Nov 2011
by JoshM
the print out;

and again the code in my indicator;

Code: Select all

print( "test --------" +NumToStr(Date,0) +" "+ NumToStr(Time,0) + " " + NumToStr(CurrentSession(1),0) +"/" + NumToStr(sessioncount(1),0) );
condition10 =(time>SessionEndTime(1,1)+1 and time[1]<=SessionEndTime(1,1)+1);

if condition10 then
print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
The code compiles here correctly, and gives no error when added to a chart (EUR/USD with CME Equity Index Futures [Combined] template). (Edit: also no problems with ES continuous future contract, same template, time set to exchange).

Code: Select all

test --------1110726 330 3/10
test --------1110725 2145 1/5
test --------1110726 335 3/10
test --------1110725 2150 1/5
test --------1110726 340 3/10
test --------1110725 2155 1/5
test --------1110726 345 3/10
test --------1110725 2200 1/5
test --------1110726 350 3/10
test --------1110725 2205 1/5
test --------1110726 355 3/10
test --------1110725 2210 1/5
test --------1110726 400 3/10
test --------1110725 2215 1/5
test --------1110726 405 3/10
test --------1110725 2220 1/5
test --------1110726 410 3/10
test --------1110725 2225 1/5
test --------1110726 415 3/10
test --------1110725 2230 1/5
test --------1110726 420 3/10
test --------1110725 2235 1/5
test --------1110726 425 3/10
test --------1110725 2240 1/5
test --------1110726 430 3/10
test --------1110725 2245 1/5
test --------1110726 435 3/10
test --------1110725 2250 1/5
test --------1110726 440 3/10
test --------1110725 2255 1/5
test --------1110726 445 3/10
test --------1110725 2258 1/5
test --------1110726 450 3/10
test --------1110725 2311 2/5
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
This works both with chart set to Exchange or Local time, and also in PlayBack (that you used in the screenshot). I'm in the same time zone as France, so that also can't explain it.

In other words, the STD Exception error has to originate from somewhere else, in my opinion.

Regards,
Josh

Re: Session and Autotrade

Posted: 07 Nov 2011
by Henry MultiСharts

Code: Select all

print( "test --------" + NumToStr(Time,0) + " " + NumToStr(CurrentSession(0),0));
condition10 =(time>SessionEndTime(0,1)+1 and time[1]<=SessionEndTime(0,1)+1);

if condition10 then
print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
this code got an error in running time, when using a 1 min frame.
STD exception: invalid argument
With 15 mins it does not.

Why? How can I make it work?
Hello Sir.
Please let me know who is your datafeed and what exact version of MultiCharts are you running.
Please also attach the workspace you are using for analysis.

Re: Session and Autotrade

Posted: 07 Nov 2011
by HummerH1
datafeed: esignal
multichart version: 7.0 Release (Build 4510)
here attached: the workspace.
there's nothing on it except these 2 lines code

Re: Session and Autotrade

Posted: 08 Nov 2011
by Henry MultiСharts
Sir please export the data for ES #F symbol from eSignal.
You can do it in Quote Manager->right click on ES #F->Export data->Export instrument.

Re: Session and Autotrade

Posted: 08 Nov 2011
by HummerH1
To export and send it to you?

Re: Session and Autotrade

Posted: 08 Nov 2011
by Henry MultiСharts
Yes please send it to my email support@multicharts.com

Re: Session and Autotrade

Posted: 08 Nov 2011
by HummerH1
Ok. Im at work now. Ill dot it when ill be at home in about 2, 3 hours

Re: Session and Autotrade

Posted: 08 Nov 2011
by HummerH1
Sent

Re: Session and Autotrade

Posted: 17 Nov 2011
by Henry MultiСharts

Code: Select all

print( "test --------" + NumToStr(Time,0) + " " + NumToStr(CurrentSession(0),0));
condition10 =(time>SessionEndTime(0,1)+1 and time[1]<=SessionEndTime(0,1)+1);

if condition10 then
print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
this code got an error in running time, when using a 1 min frame.
STD exception: invalid argument
With 15 mins it does not.

Why? How can I make it work?
STD exception issue is confirmed as a bug.
It will be fixed in Multicharts 7.4
This version is expected in a week.
There is no exact release date at the moment.

Re: Session and Autotrade

Posted: 27 Nov 2011
by Erik Pepping
As an extra point to this. Keep in mind that Stop for profit ans stoploss with SetProfitTarget and SetStopLoss are sent to the broker. I found out that for instance IB fills your stops before market. or After market sometimes, regardless of your session settings. This is off course logical, but still keep it in mind.

Re: Session and Autotrade

Posted: 27 Nov 2011
by TJ
As an extra point to this. Keep in mind that Stop for profit ans stoploss with SetProfitTarget and SetStopLoss are sent to the broker. I found out that for instance IB fills your stops before market. or After market sometimes, regardless of your session settings. This is off course logical, but still keep it in mind.
You have to set in TWS to not fill orders outside of RTH.

Re: Session and Autotrade

Posted: 27 Nov 2011
by Erik Pepping
yes but that means that for instance for dax futures it does not trade after 17.30. But i want that. I do not want it in the morning however. I do not think that is an option.

Re: Session and Autotrade

Posted: 27 Nov 2011
by TJ
yes but that means that for instance for dax futures it does not trade after 17.30. But i want that. I do not want it in the morning however. I do not think that is an option.
Every tool has a specific purpose.

SetProfitTarget and SetStopLoss are GLOBAL exits.

If your activities are NOT Global... don't use them.

Please read post #3 in detail:
viewtopic.php?f=16&t=6929