Help. One trade per hour ea and count trades?
Results 1 to 2 of 2

Thread: Help. One trade per hour ea and count trades?

  1. #1
    It's possible to use this function to calculate number of consecutive losses

    int CountLosses()

    int orders=HistoryTotal(); // background orders complete
    int losses=0; // number of losses orders without a fracture

    //-- calculate number of loosing trades without a rest at precisely the exact same day
    for(int I=orders-1;igt;=0;I--)
    OrderType()gt;OP_SELL) continue;
    //--
    if(OrderProfit()gt;0) break;
    if(OrderProfit()lt;0 TimeDay(OrderOpenTime()) == TimeDay(Timing[0])) Gains ;

    //-- yield losses
    yield(losses);


    to use it :
    int Losses = CountLosses();

    to limit 1 trade per hour:
    define global variable, place before int start(), title it LastHourBar

    int LastHourBar=0;
    ....
    Int start()
    {
    ...
    if(Buy/Sell Condition == True... iBars(NULL,PERIOD_H1) ! = LastHourBar)

    OrderSend(...)
    LastHourBar = iBars(NULL,PERIOD_H1);
    ...

  2. #2
    Hello all. Can someone help me?
    How can I tell the EA, that when 2 orders after you another are loses, he miss the third? Then start to count.
    And that he create only 1 trade per hour? Can there be a code someone can help me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.