Time format "disorientation"

Questions about MultiCharts and user contributed studies.
palmone
Posts: 34
Joined: 24 Apr 2014
Has thanked: 4 times
Been thanked: 2 times

Time format "disorientation"

Postby palmone » 01 Sep 2014

Hi guys,
Mc plot the time in the chart starting from "the finish time frame".
i mean an hourly candle at 11: 00 a.m plotted in the chart means the time from 10:00-11:00.

When i code time filters in a strategy ,for example I don't want take a position after 11:00, i have to say:

t<1100 or t<1200 ?? due to the logic of mc charts it seem to be the second one but i'm not sure.
Maybe is stupid but i'm getting crazy with this stuff because i'm passing lot of code from an older sofware that use the logic 10:00 means the start of the candle (10::-11:00)

thanks a lot,
Alfredo

evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 124 times

Re: Time format "disorientation"

Postby evdl » 01 Sep 2014

It is the first one, I believe.

T < 1100

With print statements you can check the outcome of code you use.

palmone
Posts: 34
Joined: 24 Apr 2014
Has thanked: 4 times
Been thanked: 2 times

Re: Time format "disorientation"

Postby palmone » 01 Sep 2014

thank you very much for response evdl.
Based on the charts it seems that 11:00 is the bar from 10:00 to 11:00 so i tought that t<1100 mean "do not trade after 10:00.
For print statement you mean adding code in the signal to write text or a debugger option in power language?

evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 124 times

Re: Time format "disorientation"

Postby evdl » 01 Sep 2014

Just quickly checked this.

Best is to use

Code: Select all

If Time <= 1100
With print statements like this

Code: Select all

If time_s <= 110000 then begin
Print("Date:",formatdate("dd-MM-yy",eldatetodatetime(date))," Time:", FormatTime("HH:mm:ss", el_timetodatetime_s(time_s)),
" close:", close);
end;
you can output text in the editor and see what happens. With time <= 1100 it will also get the close at 1100 and with time < 1100 it will get the close of 1000.

palmone
Posts: 34
Joined: 24 Apr 2014
Has thanked: 4 times
Been thanked: 2 times

Re: Time format "disorientation"

Postby palmone » 01 Sep 2014

thanks evdl i will work on it, i never use print function i have to study it before!

User avatar
CrazyNasdaq
Posts: 318
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 97 times
Been thanked: 86 times

Re: Time format "disorientation"

Postby CrazyNasdaq » 01 Sep 2014

Your condition to NOT take position after 11:00 must be this way:

Code: Select all

if time > 1100 then begin
.... (stop trade)
end;
or better you must create a condition to take trades ONLY IF time is before 11:00, so:

Code: Select all

if time <= 1100 then begin
.... (trades conditions)
end;
if trades must be only into a braket of time:

Code: Select all

if time >= begin.time and time <= End.time then begin
..... (Trade conditions)
end;

palmone
Posts: 34
Joined: 24 Apr 2014
Has thanked: 4 times
Been thanked: 2 times

Re: Time format "disorientation"

Postby palmone » 02 Sep 2014

Thank you guys for your help, now situation is clear!


Return to “MultiCharts”