Page 1 of 3 123 LastLast
Results 1 to 10 of 26
 0 Attachment(s)    

Thread: Modifications for a 5 digits broker

  1. #1
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default Modifications for a 5 digits broker

    You have just to multiply the StopLoss, TakeProfit, TrailingStop and BreakEven by 10.

  2. #2

    Default

    Quote Originally Posted by funyoo View Post
    You have just to multiply the StopLoss, TakeProfit, TrailingStop and BreakEven by 10.
    hy
    what is the point in 5digit broker?
    if sometimes it's nesessery to use f.e. distance between main and signal stoch line and it's 5 on 4digit , so on 5digit brokers we must multiply value of distance by 10 as SL ?

  3. #3

    Default

    Quote Originally Posted by przem81621 View Post
    hy
    what is the point in 5digit broker?
    if sometimes it's nesessery to use f.e. distance between main and signal stoch line and it's 5 on 4digit , so on 5digit brokers we must multiply value of distance by 10 as SL ?
    The point of a 3/5-digit broker is that it gives them the opportunity to offer tighter spreads (eg 2..5 pips instead of 3 pips).

    There is another thread on the go which gives ideas on how to automatically adjust TPs and SLs inside an EA so that they will work on 3/5-digit brokers without having to multiply any of the variables by 10.

    The logic is simple. You halve the digits and take the MathFloor of the result.

    So for a 5-digit broker, this will return 2. You then multiply this result by 2 and if the answer is less than the digits you multiply TPs, SLs, etc by a factor of 10 before processing them further in OrderSend() functions.

  4. #4

    Default

    You will need to declare the variables first. They will probably be different to mine anyway.

    Then .........

    Code:
    //Code to adjust stop-losses for odd Alpari Point
    NewPipsBeforeSLatBreakeven=PipsBeforeSLatBreakeven;
    NewPipsToTrail=PipsToTrail;
    NewAddLevelPoints=AddLevelPoints;
    
    int HalfDigits,DoubleDigits;
    HalfDigits=MathFloor(MarketInfo(Symbol(),MODE_DIGITS)/2);
    DoubleDigits=HalfDigits*2;
    if(DoubleDigits!=MarketInfo(Symbol(),MODE_DIGITS)) {NewPipsBeforeSLatBreakeven=PipsBeforeSLatBreakeven*10; NewPipsToTrail=PipsToTrail*10; NewAddLevelPoints=AddLevelPoints*10;}
    //End of code to adjust stop-losses

  5. #5

    Default

    [QUOTE=jezzer1961;7938]You will need to declare the variables first. They will probably be different to mine anyway.

    Then .........

    yes, thanks
    it's clear.
    but, i asked about value of indicators and distance between lines.

    if(Rsi(1)-Rsi(0))>distance4dig* Point ....
    it will be the same on 5 digit broker?

    if Point on 4-broker = 0.0001 and for 5digit it.s = 0.00001 ,
    so if i want the same value it's mean that must for 5 digit broker
    dictance5dig=10*distance4dig

    am i wright ?

  6. #6

    Default

    Sorry, I haven't got a clue what you're trying to do there.

  7. #7

    Default

    Quote Originally Posted by przem81621 View Post
    hy
    what is the point in 5digit broker?
    if sometimes it's nesessery to use f.e. distance between main and signal stoch line and it's 5 on 4digit , so on 5digit brokers we must multiply value of distance by 10 as SL ?
    This has been puzzling me, but I think I understand what you're trying to say now.

    No, you don't have to multiply anything at all with an indicator buffer for different brokers. The multiplication is only to convert price points.

  8. #8

    Default

    Quote Originally Posted by jezzer1961 View Post
    This has been puzzling me, but I think I understand what you're trying to say now.

    No, you don't have to multiply anything at all with an indicator buffer for different brokers. The multiplication is only to convert price points.
    thanks jezz
    sorry that my english is so hard to undestand
    of course I don't want multiply value of indicators.
    Look , in some ea is that condition :
    ...
    extern bool UseDistance=false;
    extern double Distance=7;
    ...
    if(UseDistance&&(HMAA-HMAB)>=Distance*Point)HMABuy="true";
    ...

    question was :
    if Distance on 4brokers is 7 , it should be 7 on 5brokers or 70 ?

    if we know that Point = ...?

  9. #9

    Default

    Quote Originally Posted by przem81621 View Post
    thanks jezz
    sorry that my english is so hard to undestand
    of course I don't want multiply value of indicators.
    Look , in some ea is that condition :
    ...
    extern bool UseDistance=false;
    extern double Distance=7;
    ...
    if(UseDistance&&(HMAA-HMAB)>=Distance*Point)HMABuy="true";
    ...

    question was :
    if Distance on 4brokers is 7 , it should be 7 on 5brokers or 70 ?

    if we know that Point = ...?
    Don't worry about your English. Mine is pretty bad too and I'm from London.

    So that I get this right, what are HMAA and HMAB? I'm guessing, but are they moving averages?

  10. #10

    Default

    Quote Originally Posted by jezzer1961 View Post
    Don't worry about your English. Mine is pretty bad too and I'm from London.

    So that I get this right, what are HMAA and HMAB? I'm guessing, but are they moving averages?
    double HMAA=iCustom(Symbol(),0,"HMA",HMAPeriod1,HMAMethod 1,HMAPrice1,2,0);
    double HMAB=iCustom(Symbol(),0,"HMA",HMAPeriod2,HMAMethod 2,HMAPrice2,2,0);

    hma indicator

Similar Threads

  1. How to use an EA with a 5 digits broker
    By funyoo in forum Trading discussion
    Replies: 8
    Last Post: 04-07-2016, 13:58
  2. Phoenix_EA for 5 digits broker
    By r_wilson in forum Ideas for expert advisors
    Replies: 12
    Last Post: 05-25-2011, 18:45
  3. Price Bounce Off of MA EA - Excellent Potential Needs Modifications
    By kneal in forum Ideas for expert advisors
    Replies: 4
    Last Post: 12-07-2010, 16:16
  4. Replies: 3
    Last Post: 06-14-2010, 16:49
  5. Modifications for ECN brokers
    By funyoo in forum MQL programming
    Replies: 6
    Last Post: 01-11-2010, 14:53

Tags for this Thread

alpari, average, breakeven, broker, brokers, change, color, eas, expert, guide, how to, indicator, indicators, main, moving average, offer, rsi, signal, simple, slippage, stoch, stop, stoploss, trailingstop

Posting Permissions

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