Results 1 to 5 of 5
 0 Attachment(s)    

Thread: NewBarBuy() & NewBarSell()

  1. #1

    Question NewBarBuy() & NewBarSell()

    Hello! I am just curious, why Funyoo uses the NewBarBuy and NewBarSell functions, is it because of Hedge function?

    bool NewBarBuy()
    {
    if(PreviousBarTime1<Time[0])
    {
    PreviousBarTime1=Time[0];
    return(true);
    }
    return(false);
    }

    bool NewBarSell()
    {
    if(PreviousBarTime2<Time[0])
    {
    PreviousBarTime2=Time[0];
    return(true);
    }
    return(false);
    }

  2. #2

    Smile Controlling trades per bar

    Quote Originally Posted by szmvscla View Post
    Hello! I am just curious, why Funyoo uses the NewBarBuy and NewBarSell functions, is it because of Hedge function?
    Hi szmvscla,
    Its meant to stop the ea doing more than 1 trade or pair of trades on the 1 bar.

    You dont want the ea seeing a signal & entering a trade then entering again & again while the signal is still true for the same bar.

    Thought I spotted a thread on it in this MQL programming section, but now cant find it. sorry.

    cheers bt2

  3. #3

    Question

    Quote Originally Posted by bt2 View Post
    Hi szmvscla,
    Its meant to stop the ea doing more than 1 trade or pair of trades on the 1 bar.

    You dont want the ea seeing a signal & entering a trade then entering again & again while the signal is still true for the same bar.

    Thought I spotted a thread on it in this MQL programming section, but now cant find it. sorry.

    cheers bt2
    Thanks, but just one newbar function, isn't enough?

  4. #4

    Thumbs up Mmmmmm, Good point

    Quote Originally Posted by szmvscla View Post
    Thanks, but just one newbar function, isn't enough?
    Mmmmmm, Good point,
    I have been running an ea with them commented to the screen, alongwith other junk. I did notice that they were switching to 1 & back to 0 together on the same processing passes.

    Spose you only expect either a sell signal or a buy signal at each new bar, not both.

    What ea you playing with ?

    cheers bt2

  5. #5

    Thumbs up

    Quote Originally Posted by bt2 View Post
    Mmmmmm, Good point,
    I have been running an ea with them commented to the screen, alongwith other junk. I did notice that they were switching to 1 & back to 0 together on the same processing passes.

    Spose you only expect either a sell signal or a buy signal at each new bar, not both.

    What ea you playing with ?

    cheers bt2
    Hi! I am still having problem about the new bar, I've posted a new thread, if you know the answer for my problem, please let me know. I am learning how to code and I am not working for a specific EA, just coding and trying some eas from here like the Taichi Demarker.

Tags for this Thread

coding, funyoo, hedge, how to, mql, programming, signal, stop

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •