Signal Time de/activator  [SOLVED]

Questions about MultiCharts and user contributed studies.
elitetrader
Posts: 18
Joined: 06 Jun 2016

Signal Time de/activator

Postby elitetrader » 06 Jun 2016

How do i write a code so my signal can function between set time periods of the day for example i want my signal to function between 8 am and 3 pm and to close the trade its in at 30 pm and stop trading until the next day at 8am again.

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

Re: Signal Time de/activator  [SOLVED]

Postby TJ » 06 Jun 2016

How do i write a code so my signal can function between set time periods of the day for example i want my signal to function between 8 am and 3 pm and to close the trade its in at 30 pm and stop trading until the next day at 8am again.

See post #15
[FAQ] Limit the Time of Autotrade
viewtopic.php?f=16&t=10811

elitetrader
Posts: 18
Joined: 06 Jun 2016

Re: Signal Time de/activator

Postby elitetrader » 06 Jun 2016

if time >= start.time
and time <= end.time then
BEGIN
if var0 crosses above botBand then buy next bar at market;
if var0 crosses below topBand then sellshort next bar at market;
END;

how do i get it to close the trade when time expires?

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

Re: Signal Time de/activator

Postby TJ » 06 Jun 2016

see post 1 & 2
[FAQ] How to Post Codes (... so that people can read)
viewtopic.php?f=16&t=11713

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

Re: Signal Time de/activator

Postby TJ » 06 Jun 2016

If you are new
and want to learn more about programming your own strategy,
you should take a look at other threads in the forum.

eg. this one is next to your thread:
viewtopic.php?f=1&t=49850


Return to “MultiCharts”