EA Sessions

  • Toggle between activate and inactive sessions for the PineConnector EA
  • The down-arrows signify halt EAwhile the up-arrows signify resume EA
  • An alert will automatically be sent to the PineConnector server for the EA on your MT4/5 to toggle the EA status
  • Timezone set to New York time (GMT-4/UTC-4)
  • Script uses PineScript Version 5 

How to use this script:
  1. Create a PineScript and attach the code below
  2. Attach the script to your chart
  3. Edit the License ID
  4. Edit your preferred timezone and preferred session timings 
  5. Create alerts 
    1. After changing anything from (3 or 4), please create a new alert

If you code your own strategy, you want to adopt the code into your script instead of running the the suggested code below separately.


// © PineConnector

indicator("PineConnector Sessions", "", true)
timestart = time(timeframe.period, "0600-0601:23456", "GMT-4") //if you are in London, use -0, if you are in Singapore, use +8
timeend = time(timeframe.period, "2000-2001:23456", "GMT-4") //if you are in London, use -0, if you are in Singapore, use +8

timeactive = time(timeframe.period, "0600-2000:23456", "GMT-4") //ensure start and end time matches the above 2 lines of code

bgcolor(timeactive ? color.new(color.green,80) : color.new(color.red, 80))

plotshape(timestart, style=shape.labelup, location=location.belowbar, color=color.green, size=size.large, text='Reactivate \nPineConnector EA', textcolor=color.white)
plotshape(timeend, style=shape.labeldown, location=location.abovebar, color=color.red, size=size.large, text='Halt \nPineConnector EA', textcolor=color.white)

if timestart
    alert("CHANGETOYOURLICENSEID,eaon,eaon", alert.freq_once_per_bar)
if timeend
    alert("CHANGETOYOURLICENSEID,eaoff,eaoff", alert.freq_once_per_bar)


  • I modified the script with the ID in my use, but at the change of the time slot the EA does not change the status, what can it depend on?

    Daniele Bigazzi
  • thank you very much


Leave a comment