Could someone help with this:-
Need to enter on close> EntryMA,and exit on close < ExitMA and entry and exits must only occur between EntryTime and ExitTime.
This signal takes the long trades only.
Once it works,I can modify to run a short signal as preference is to have a long signal in one chart and a short signal in another chart initially
Appreciate the help
Milton
[inputs:
{Long trades only in this signal}
Price( Close ),
Length( 9 ) ,
EntryMA (27),
ExitMA (9),
EntryTime(>=949 and <=430),//Entries can only occur in the day session.
ExitTime(>=949 and <=2300);//Late day entries,can exit in the night session.
variables:
EntryMA = AverageFC( Price,Length);
ExitMA = AverageFC( Price, Length) ;
if Price close above EntryMA
and time = EntryTime
then
Buy ( "EntryMA" ) next bar at market ;
if CurrentBar > 1 and Price close under ExitMA
and time >= ExitTime
then
Sell ( "ExitMA" ) next bar at market ;
{ ** Copyright (c) 1991-2003 TS Technologies, Inc. All rights reserved. **
** TS reserves the right to modify or overwrite this strategy component
with each release. ** }
][/code]
Signal help Please
- Andrew Kirillov
- Posts: 1589
- Joined: 28 Jul 2005
- Has thanked: 2 times
- Been thanked: 31 times
- Contact:
Here is a correct script.
inputs:
{Long trades only in this signal}
Price( Close ),
Length( 9 ) ,
EntryTimeBeginInterval(0949),//Entries can only occur in the day session.
EntryTimeEndInterval(1630),
ExitTimeBeginInterval(0949),//Late day entries ,can exit in the night session.
ExitTimeEndInterval(2300);
variables: EntryMA(0), ExitMA(0);
EntryMA = AverageFC( Price,Length);
ExitMA = AverageFC( Price, Length) ;
if Price crosses above EntryMA and
(time >= EntryTimeBeginInterval and time <= EntryTimeEndInterval)
then
Buy ( "EntryMA" ) next bar at market ;
if CurrentBar > 1 and Price crosses under ExitMA and
(time >= ExitTimeBeginInterval and time <= ExitTimeEndInterval)
then
Sell ( "ExitMA" ) next bar at market ;
inputs:
{Long trades only in this signal}
Price( Close ),
Length( 9 ) ,
EntryTimeBeginInterval(0949),//Entries can only occur in the day session.
EntryTimeEndInterval(1630),
ExitTimeBeginInterval(0949),//Late day entries ,can exit in the night session.
ExitTimeEndInterval(2300);
variables: EntryMA(0), ExitMA(0);
EntryMA = AverageFC( Price,Length);
ExitMA = AverageFC( Price, Length) ;
if Price crosses above EntryMA and
(time >= EntryTimeBeginInterval and time <= EntryTimeEndInterval)
then
Buy ( "EntryMA" ) next bar at market ;
if CurrentBar > 1 and Price crosses under ExitMA and
(time >= ExitTimeBeginInterval and time <= ExitTimeEndInterval)
then
Sell ( "ExitMA" ) next bar at market ;
- Andrew Kirillov
- Posts: 1589
- Joined: 28 Jul 2005
- Has thanked: 2 times
- Been thanked: 31 times
- Contact: