Need Help in Coding!
Page 1 of 613 123 LastLast
Results 1 to 10 of 23

Thread: Need Help in Coding!

  1. #1
    I've created a very straightforward EA. . And a system which I use in 3 Timeframe..May difficulty it doesn't stop opening and I don't wish to have 3 EA and 3 chart for a single pair. .

    I want a code which would just do one order each bar per TF and still open if it's on another bar. .

    Occasionally I have 3 sign in 3 different TF. . I want to have all order but I want only order each TF and I can still take another order exactly the same TF if it's still open but in another bar. .

    Instance:
    1 sign in 4h
    1 sign in 1h but it drops in bar for 4h
    1 sign in 30 min but just one bar for 1h and 4h. .

    I am fine with using magicnumber

    can someone help me? Thank you very much. .

  2. #2

  3. #3
    Quote Originally Posted by ;
    I will take a peek at that.
    Thank you. . Hope to hear from you. .

  4. #4

  5. #5
    What can I do with this code? Or I am not using the code. .

    Time(OrderOpenTime()) = iTime(Symbol(),PERIOD_M30,0)

  6. #6
    I think that my explaination is poor. . Try to explain

    I need a code that can take a minumum of one order for buy and sell per pub. .

    But a few times I have 3 sign for one pub in greater TF cause I use 3 TF and each has different signs but it falls on precisely the exact same pub for greater TF.

    So far that is my solution:
    I am okay with using magic number as a piece of filter.

    Can someone help me? Thank you very much.

    So far that is what I thought:
    for 30 mins
    if (magicnumber == 123)

    if (iTime(OrderOpenTime()) ! ) = iTime(Symbol(),PERIOD_M30,0))
    //my order code



    I do not possess MT4 but I know somethings isn't right in the logic or code. So guys please help me.

  7. #7
    Would this job???

    Int init()

    LastBuyTime = 0;
    LastSellTime = 0;


    int start()

    if (Buy Requirements Met)

    if (Period [0] gt; LastBuyTime) //check the time of past buy order
    //process order
    OrderSend(blah blah blah);
    if (No Error) LastBuyTime = Time[0];


    //repeat the Exact Same for Sell
    return(0);

  8. #8
    In the event you use separate EA for different time frame, then the above code should work
    if it works, it ought to be better in comparison to sending information to in your server all the time to inspect the OrderOpenTime()??

    But if you use the same EA for different time frame
    afterward in the event that you want to do the same with every time frame then either use arrays
    ie. LastBuyTime[Stage ()]
    or in the event that you only exchange 3 time frame then use
    LastBuyTimeM15
    LastBuyTimeH1
    LastBuyTimeH4
    etc.etc. .


    If the array method is too messy as it creates 240 arrays if you exchange 4 hour chart, then you need separate code to automatically convert interval () to an integer, ie. 1minute=0, 5 minute =1, 15min = two etc.etc. And utilize this integer to reference the array...

  9. #9
    And if you're afraid that there is too many ticks happening in exactly the exact same second, then you might also record the Volume down [0] of this moment when you last put the order to be certain it will not put 2 orders at the exact same second...

  10. #10
    I will use one EA and a single chart to exchange 3 TF. .

    Anyways, I do not know a lot about variety and therefore I will try the last code you posted. . It'd be appreciated, if you can give me a bit of details about how to attach. . Thank you. .

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.