Announcement

Collapse
No announcement yet.

Intarday trade

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Intarday trade

    I am trying to write a study that limits the trades to only the day of the initial day. Example: if a short position was taken on 7/3, it would be covered before 7/4. Can this be done?

  • #2
    One way is to look at the various date time functions and decide when (hour, day, minute, etc.) you want to get out. If you want to get automatic you will also have to deal with holidays.

    var mn_0=getMinute(0); // get minutes current bar
    var hr_0=getHour(0); // get current hour
    var Date = getValue("Time", 0);
    var DayOfWeek=Date.getDay(); //get current day

    are some examples of use to help you get started.

    Comment


    • #3
      forgot to mention, you need to be receiving active tick data for your efs main code to be run so make sure you close out before market data ticks end. If you are autotrading via Ninja dll communication with Ninja software, there is also an option in their control module to autoflatten at a certain time.

      Comment

      Working...
      X