+ Reply to Thread
Results 1 to 3 of 3
 0 Attachment(s)    

Thread: Change of bar versus each tick

  1. #1
    Junior Member
    Join Date
    Dec 2008
    Posts
    2

    Default Change of bar versus each tick

    What code do I need to use in order to perform actions only when a bar changes instead of when there is a new tick?

    Thanks,

    saintmo

  2. #2
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,455

    Default

    Quote Originally Posted by saintmo View Post
    What code do I need to use in order to perform actions only when a bar changes instead of when there is a new tick?

    Thanks,

    saintmo
    Hi saintmo and welcome,

    You have to add a limitation per bar, when the actions have been applied.

    At the top, add :

    Code:
    extern int MaxActionsPerBar=1;
    int ActionsPerBar=0;
    int BarCount=-1;
    Before the actions add :

    Code:
    if(BarCount!=Bars){ActionsPerBar=0;BarCount=Bars;}
    In line, after the conditions required to apply the actions :

    Code:
    &&(ActionsPerBar<=MaxActionsPerBar)
    After the actions, add :

    Code:
    ActionsPerBar++;

  3. #3
    Junior Member
    Join Date
    Dec 2008
    Posts
    2

    Default

    funnyoo,

    Awesome. Thank you so much. I have been searching for how to do this for some time. I will give this a shot,

    Thanks again,

    saintmo

+ Reply to Thread

Similar Threads

  1. Pipstep change as more orders are placed
    By BillR in forum MQL programming
    Replies: 9
    Last Post: 04-14-2009, 05:43
  2. Change the color of an indicator
    By domick in forum MQL programming
    Replies: 7
    Last Post: 04-03-2009, 17:13
  3. Tick Trader
    By funyoo in forum Expert advisors backtesting
    Replies: 0
    Last Post: 03-23-2009, 22:58
  4. Market activity change, EA additive
    By viplala in forum MQL programming
    Replies: 3
    Last Post: 03-11-2009, 12:21
  5. Change soundalert and message pop-up window
    By crissfx in forum MQL programming
    Replies: 2
    Last Post: 01-22-2009, 12:54

Posting Permissions

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