help with time entry and time exit

Questions about MultiCharts and user contributed studies.
karlelias
Posts: 7
Joined: 23 Nov 2013

help with time entry and time exit

Postby karlelias » 04 Nov 2014

hi,

I dont know how to code for ex.

If i want to make an entry 10.00 and exit 17.09 . How do i code this if i have the strategy on days? Do i need to change in to minutes?

Please can someone help me with this.

Thanks

maisatomai
Posts: 83
Joined: 18 Mar 2013
Has thanked: 11 times

Re: help with time entry and time exit

Postby maisatomai » 04 Nov 2014

Code: Select all

[intrabargeneration=true]
if t[0]=XXXX then
buy this bar at close
if t[0]=YYYY then
sell this bar at close
Last edited by maisatomai on 04 Nov 2014, edited 1 time in total.

User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: help with time entry and time exit

Postby furytrader » 04 Nov 2014

Are you saying that you want to enter the market at 10:00 am and exit at 5:09 pm?

If you're going to use a reference to a bar's time to figure out when to enter or exit, I would say that you'd have to shift to a 1 minute timeframe. There may be a way to reference your computer's clock tick-by-tick as a day bar is created in realtime, but I'm not familiar with those.

EDIT: The command to do this would be "CurrentTime"

You could use intrabarordergeneration on a day bar and check currenttime with each tick to see if it matches the criteria you want.
Last edited by furytrader on 04 Nov 2014, edited 1 time in total.

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

Re: help with time entry and time exit

Postby TJ » 04 Nov 2014

[intrabargeneration=true]
if t[0]=XXXX then
buy this bar at close
if t[0]=YYYY then
sell this bar at close
See post #7
[FAQ] This Bar on Close
viewtopic.php?f=16&t=10811


ps.
viewtopic.php?f=16&t=11713


Return to “MultiCharts”