Need Help in Coding! - Page 2
Page 2 of 613 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: Need Help in Coding!

  1. #11
    I have a question. .

    Would current time be equal to pub?

    Ei:

    int init()

    LastBuyTime = 0;
    LastSellTime = 0;


    int start()

    if (OrderOpentime() gt; LastBuyTime30) //assess time of last buy order

    LastBuyTime30 = OrderOpenTime ()

    should LastBuyTime30 lt; iTime(,period,0) (magicnumber ! ) = 123)
    the buy order condition
    return(0);

  2. #12
    In the event you exchange 3 time frame using one chart using the identical EA, it becomes much more complied, as Time[0] returns the beginning time of the current un-closed candle on your chart, thus you will require some code to filter out the period range of every candle.
    The dilemma is not as complied if you exchange just 15min, hourly daily, coz if you inserted the EA from the 15min chart, then you can use the TimeHour() function to filter out the hour of the previous tick and it's rather easy...
    but should you exchange 4hour and 1hour chart in the same time, then you will need more code, ie. (NormalizeDouble(TimeHour(TimeCurrent())/4),0) * 4 will return the start time of the current 4 hour candle, then you have to use this value and with the purpose DayOfYear Year to store the time when you last entered an order when triggered by 4 hour sign...

  3. #13
    The solution for your issue seem very complied... if you have to trade 3 different time frames using a single chart...

    note: the example is still trying to recover the Last order time in the server (OrderOpenTime()) which I don't recommend as it generates extra network traffic and may create unneccesary network traffic for your own server if your EA is looped too many times per second

  4. #14
    Quote Originally Posted by ;
    the remedy to your problem seem very complied... in case you must trade 3 different time frames with a single chart...

    notice: your case is still hoping to recover the previous order time in the server (OrderOpenTime()) that I don't recommend as it creates extra network traffic and may produce unneccesary network traffic to your server in case your EA is looped a lot of times per minute
    Thank you. . I like your idea but the problem is I am not good at coding. .

    If you show me a basic on how best to attach what your posted here. . I don't know how to code arrays. . Thank you. .

    Another question what should my EA or MT4 reset? At the same time it required order will it require yet another order ?

  5. #15
    Can somebody stop this from modifing my order over and over again? Can someone give me assistance on code to get step? Like do trail stop every 10 pips or 5 pips instead of 1 pips. . Can someone give me a code?

    Quote Originally Posted by ;
    void BEM ()

    int pips;
    for (int k=0; klt;OrdersTotal ();k )

    OrderSelect(k, SELECT_BY_POS, MODE_TRADES);
    if(OrderType()==OP_BUY OrderSymbol()== Symbol () OrderMagicNumber()== Magic)

    pips = (Bid - OrderOpenPrice())/Stage;
    if ((pips gt;= BE) (OrderStopLoss() lt; OrderOpenPrice()))

    OrderModify (OrderTicket (), OrderOpenPrice (),OrderOpenPrice () 12*Stage, OrderTakeProfit (), 0, LightBlue);


    if(OrderType()==OP_SELL OrderSymbol()== Symbol () OrderMagicNumber()== Magic)

    pips = (OrderOpenPrice() - Ask)/Stage;
    if ((pips gt;= BE) (OrderStopLoss() gt; OrderOpenPrice()))

    OrderModify (OrderTicket (), OrderOpenPrice (),OrderOpenPrice ()- 12*Stage, OrderTakeProfit (), 0, Pink);



  6. #16
    Arrays is exactly like a variable, except that you use one variable name and utilize a number to reference all the principles, Time[], High[], Low[], Open[], Close[] etc.etc are examples of variable

    I'd like to help more, but I've been very busy, and it's difficult for me to help you in the event that you do not understand how to apply what I've suggested, you'll need to read the documentation on mq4 to attempt and learn more about the coding for now. .

  7. #17
    Quote Originally Posted by ;
    another question what if my EA or MT4 reset? At precisely the same time it required order will it require yet another order again?
    Your EA must have codes, that when it first loads to assess if any sign happen to be triggered with the most recent candle, and if so, resets the trigger/counter, hence preventing the EA from ever opening orders/creating alerts on the instance that the EA is loaded. .

  8. #18
    thanks. . If you do not mind. . You can post an EA here with range I can study the code from that point. .

    Anyways, you have been of great help. .

  9. #19
    Can anyone give me the code for measure? One was created by me before but it loops and loops

  10. #20
    Quote Originally Posted by ;
    thanks.. If you do not mind. . Perhaps you can post an EA here I could study the code from there. .
    Array is just as any other factor, hard to give an illustration
    if you declare a variable, instead of int MyValues, you declare it as int MyValues[n] instead, in which n is the number of factors in your array,
    so instead of having MyValues1=1.5400; MyValues2=1.5450; MyValues3=1.5520;
    you could get an array, declare it as int MyValues[3]
    then MyValues[1]=1.5400; MyValues[two ]=1.5450; MyValues[3]=1.5520;

    it may look silly, but if you're coping with a lot of values, it seems sensible...

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.