Announcement

Collapse
No announcement yet.

Automated trading script

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

  • Automated trading script

    Hallo Forum

    I am trying to establish a buy order whenever the Heikin Ashi lines crosses each other. The only problem is that it keeps on going - indefinitely. How can I make sure only one order is fired?


    Kind regards
    Attached Files

  • #2
    Invisible lines crossing?

    Hallo Forum

    After adjusting The Heikin Ashi script the lines has become invisible, can any one please help making them visible again?

    Kind regards

    G
    Attached Files

    Comment


    • #3
      As far as I am concerned, I am using the return statement in the last line:

      "Return new Array(haClose,haOpen);"

      By the way there is a much more important problem with the script; the buy order

      if(haClose != null && haOpen != null) {
      if(haClose >= haOpen) {
      buyMarket( getSymbol(), 1 );
      }

      opens a myriad of positions, couldn't you please tell me how I correct this, so that the order will be executed only once?

      Mads

      Comment


      • #4
        Mads
        As you posted it the formula is returning an error. See the Formula Output window for the contents of the error message
        To resolve this remove all the lines of code that are generating that error [ie the broker function and related conditional statement] and the formula will plot the lines.
        As to the order issue you already have another thread about it so you should refer to that thread
        Alex


        Originally posted by gotan4711 View Post
        As far as I am concerned, I am using the return statement in the last line:

        "Return new Array(haClose,haOpen);"

        By the way there is a much more important problem with the script; the buy order

        if(haClose != null && haOpen != null) {
        if(haClose >= haOpen) {
        buyMarket( getSymbol(), 1 );
        }

        opens a myriad of positions, couldn't you please tell me how I correct this, so that the order will be executed only once?

        Mads

        Comment


        • #5
          Alex

          Couldn't you tell me anyway?

          Mads

          Comment

          Working...
          X