Announcement

Collapse
No announcement yet.

Limiting the Trades

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

  • Limiting the Trades

    Hello,

    Currently I have an EFS that sends orders to my broker. What is happening is when I apply the EFS to a chart and it is loading all the bars and when conditions are met it fires off an order.

    So by the time all data is loaded and EFS is calculated it has sent to my broker hundreds of orders (OUCH!) all on historic data.

    How can I limit the triggers to fire so that it only fires on new data?

    Thanks
    EK

  • #2
    EK
    Try enclosing the buy/sell commands in a if(getCurrentBarIndex()==0) condition (or getCurrentBarIndex()==-1 if using setComputeOnClose())
    Alex

    Comment


    • #3
      Ahh!

      Thank you very Much Alex!

      Once Again you have made my day

      Thanks
      EK

      Comment


      • #4
        EK
        As always the pleasure is mine
        Alex

        Comment

        Working...
        X