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
help with time entry and time exit
-
- Posts: 83
- Joined: 18 Mar 2013
- Has thanked: 11 times
Re: help with time entry and time exit
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.
- 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
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.
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.
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: help with time entry and time exit
See post #7[intrabargeneration=true]
if t[0]=XXXX then
buy this bar at close
if t[0]=YYYY then
sell this bar at close
[FAQ] This Bar on Close
viewtopic.php?f=16&t=10811
ps.
viewtopic.php?f=16&t=11713