Im in trouble with EA - Page 2
Page 2 of 732 FirstFirst 12
Results 11 to 15 of 315

Thread: Im in trouble with EA

  1. #11
    Quote Originally Posted by ;
    In order for the calculation to be right you must convert it in the true price change that represents that 40 pips. That is the reason you need to multiply it. Point is the equivalent to a pip for this pair. So in the instance of GBPJPY stage is 0.01. If you multiply 40 from 0.01 you receive 0.40 that will work for your own calculation.
    OK, I got you now. . So this ought to work and I could change pricepoint from 40 to 400 to get a five digit broker, yes?

    Extern pricepoint=40 //enabled drop in pips per hour prior to order send

    if((kind == _OP_Buy) (iHigh(NULL,Period_H1, two)-(pricepoint*0.0001) gt;= iClose(NULL,Period_H1,1)))

    {
    MayOpenRealOrder = true;

  2. #12
    On your top where you have the extern variables put:

    int Mult = 1;

    Subsequently from the init() put:

    if (Digits == 3 || Digits == 5)
    Mult = 10;

    Subsequently from the code You've Placed:

    if((type == _OP_Buy) (iHigh(NULL,Period_H1, Two)-(pricepoint*Stage*Mult) gt;= iClose(NULL,Period_H1,1)))

    {
    MayOpenRealOrder = true;

    This Can automatically account for a 4 or 5 digit broker.

  3. #13
    Quote Originally Posted by ;
    On your top in which you have the extern variables put:

    int Mult = 1;

    Subsequently in the init() put:

    if (Digits == 3 || Digits == 5)
    mult = 10;

    Subsequently in the code you have placed:

    if((kind == _OP_Buy) (iHigh(NULL,Period_H1, two)-(pricepoint*Stage*mult) gt;= iClose(NULL,Period_H1,1)))

    {
    MayOpenRealOrder = true;

    This can automatically account for a 5 or 4 digit broker.
    Okay, thank you for that. .

    Now, the last and essential question... Where do I paste that line of code at the EA so it doesn't do any damage but still works?

    Would someone have a look at it only to let me know where I should paste it.

    Thanks everybody, you have all been great!

  4. #14
    No, the code is not working. . Sending buy orders on a downtrend. I have it in the wrong place or perhaps it they're various orders than actual orders.

    I changed it a bit to find out whether it was the fault of the code but it is not making a huge difference.

    I've pasted some initial code so that you guys can tell me whether It's in the wrong place

    thanks A


    if(MayOpenRealOrder)

    if(! GlCheckHighLowLimit(_OrderOpenPrice, kind, typestr)) MayOpenRealOrder = false;


    if(MayOpenRealOrder)

    if(! GlCheckOpenOrdersBeforeAdding(_OrderOpenPrice, _OrderType, CurrentPrice)) MayOpenRealOrder = false;

    if(MayOpenRealOrder) //code added Aug 20 2009

    if((kind == _OP_BUY) (iHigh(NULL,PERIOD_H1,2) gt;= iClose(NULL,PERIOD_H1,1) (pricepoint*0.0001))) MayOpenRealOrder = false;

  5. #15
    Thanks so much to the folks that assisted me.

    You're a credit to this forum. .

    It is all working now, let me know if there is something I can return

    cheers

    A

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.