Announcement

Collapse
No announcement yet.

One Trade Per Day

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

  • One Trade Per Day

    how would i go about controlling the number of trades per day that a .efs strategy will do. so if for instance it was a breakout of the 7.00 and 8.00 am time period with the stop at the opposite end of the bar, if the stop is hit the strategy will not enter another trade until the next day,

    hope this makes sense,

  • #2
    shogun
    One way could be as in the following example
    Alex

    var vCntr = 1;

    function main(){

    if(getDay(0)!=getDay(-1){
    vCntr = 1;
    }

    if(vCntr<=1 && your other conditions==true){
    your strategy commands here;
    vCntr ++;
    }

    Comment


    • #3
      thanks alex that has done the job fine,

      1/ what does vCntr ++; mean, i have seen the ++ in other .efs strategies but do not yet know how to use it.

      2/ also it is not required but might be useful for future reference for me, is it possible to allow 2 trades per day ,

      Comment


      • #4
        shogun
        vCntr ++; simply increments the value by 1. You could also write it as vCntr +=1;
        To allow 2 trades a day replace the value 1 with 2 in the following line
        if(vCntr<=1 && your other conditions==true){
        Alex

        Comment


        • #5
          alex thanks again

          that all makes sense , maybe one day i will know what i am doing,

          Comment

          Working...
          X