Indicateur OBO Trend Bars, conversion code mq4 vers prorealtime

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #136673 quote
    JPP
    Participant
    New

    Bonjour,

    Pourriez vous m’aider à convertir le code mq4 ci dessous en indicateur ProRealtime. Il s’agit de l’indicateur OBO Trend Bars.

    Je vous remercie d’avance.

    extern string rem1=”//—- Definition Trend et Breakout”;
    extern int BreakoutPeriode=1;
    extern int TrendPeriode=3;
    extern string rem2=”//—- Order”;
    extern int MaxTradesPerBar=1;
    extern int StopLoss=7;
    extern int BreakEven=7;
    extern int PartialTP1=55;
    extern int PartialRatio1=30;
    extern int PartialTP2=110;
    extern int PartialRatio2=70;
    extern int TakeProfit=150;
    extern int Slippage=3;
    extern string rem3=”//—- MM: 1.Fixed 2.Geometrical 3.Proportional 4.Smart 5.TSSF”;
    extern int MMType=3;
    extern double FixedLots=0.1;
    extern int GeometricalFactor=3;
    extern int ProportionalRisk=90;
    extern int LastXTrades=10;
    extern double DecreaseFactor=2;
    extern double TSSFTrigger1=1;
    extern int TSSFRatio1=50;
    extern double TSSFTrigger2=2;
    extern int TSSFRatio2=75;
    extern double TSSFTrigger3=3;
    extern int TSSFRatio3=100;
    extern string rem4=”//—- Debug”;
    extern bool DebugMode=false;

    int Magic=12387;
    double Lots;
    bool SignalBuy=false;
    bool SignalSell=false;
    double highrange, lowrange;
    double trend, trend1, signaltrend;
    datetime LastTradeTime=0;
    int MaxTrades=false;
    int FlagPartial=0;
    int OrdersThisBar;
    int orders;
    int losses;

    int tradegagnant,tradeperdant;
    double profit, perte, avgwin, avgloss, prcwin, tssf;

    bool TradingRange;

    //+——————————————————————+
    //| expert initialization function |
    //+——————————————————————+
    int init()
    {
    //—-

    //—-
    return(0);
    }
    //+——————————————————————+
    //| expert deinitialization function |
    //+——————————————————————+
    int deinit()
    {
    //—-

    //—-
    return(0);
    }
    //+——————————————————————+
    //| expert start function |
    //+——————————————————————+
    int start()
    {
    //—-

    if (OrdersTotal()0) OrdersList();
    if (OrdersTotal()=MaxTradesPerBar)
    {MaxTrades=true;}
    else
    {MaxTrades=false;}
    if (Time[0]!=LastTradeTime)
    {OrdersThisBar=0;}

    if (Close[0]==High[0]&&Close[0]highrange&&signaltrend0&&OrdersTotal()=orders-LastXTrades;i–)
    {
    if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==False)
    {
    Print(“Erreur dans l historique!”);
    break;
    }
    if(OrderSymbol()!=Symbol() || OrderType()OP_SELL)
    continue;
    //—-
    if(OrderProfit()0)
    break;
    if(OrderProfit()1)
    Lots=NormalizeDouble(Lots-Lots*losses/DecreaseFactor,1);
    }

    if (MMType==5&&OrdersTotal()=orders-LastXTrades;j–)
    {
    if(OrderSelect(j,SELECT_BY_POS,MODE_HISTORY)==False)
    {
    Print(“Erreur dans l historique!”);
    break;
    }

    if(OrderProfit()=0)
    {
    tradegagnant++;
    profit=profit+OrderProfit();
    }
    else
    {
    tradeperdant++;
    perte=perte+OrderProfit();
    }

    }
    if (ordersLastXTrades)avgwin=profit/tradegagnant;
    if (ordersLastXTrades)avgloss=perte/tradeperdant;
    if (ordersLastXTrades)prcwin=tradegagnant/(tradegagnant+tradeperdant);
    if (ordersLastXTrades)tssf=avgwin/avgloss*((1.1-prcwin)/(prcwin-0.1)+1);

    if(tssfTSSFTrigger1&&tssfTSSFTrigger2&&tssfTSSFTrigger3)Lots=NormalizeDouble(AccountFreeMargin()*ProportionalRisk/TSSFRatio3*100/100000,1);
    }

    if(LotsPoint*BreakEven&&OrderStopLoss()!=OrderOpenPrice())
    {
    OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,LightGreen);
    return(0);
    }
    //—- PartialTP1
    if (Bid-OrderOpenPrice()Point*PartialTP1&&FlagPartial==0&&PartialTP10&&OrderLots()*PartialRatio1*PartialRatio2/10000=0.1)
    {
    OrderClose(OrderTicket(),OrderLots()*PartialRatio1/100,Bid,Slippage,Red);
    FlagPartial=1;
    return(0);
    }
    //—- PartialTP2
    if (Bid-OrderOpenPrice()Point*PartialTP2&&FlagPartial==1&&PartialTP20)
    {
    OrderClose(OrderTicket(),OrderLots()*PartialRatio2/100,Bid,Slippage,Red);
    FlagPartial=2;
    return(0);
    }
    }
    if (OrderType()==OP_SELL)
    {
    //—- BreakEven
    if (OrderOpenPrice()-AskPoint*BreakEven&&OrderStopLoss()!=OrderOpenPrice())
    {
    OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Yellow);
    return(0);
    }
    //—- PartialTP1
    if (OrderOpenPrice()-AskPoint*PartialTP1&&FlagPartial==0&&PartialTP10&&OrderLots()*PartialRatio1*PartialRatio2/10000=0.1)
    {
    OrderClose(OrderTicket(),OrderLots()*PartialRatio1/100,Ask,Slippage,Red);
    FlagPartial=1;
    return(0);
    }
    //—- PartialTP2
    if (OrderOpenPrice()-AskPoint*PartialTP2&&FlagPartial==1&&PartialTP20)
    {
    OrderClose(OrderTicket(),OrderLots()*PartialRatio2/100,Ask,Slippage,Red);
    FlagPartial=2;
    return(0);
    }
    }
    }
    }
    }

    obo-trend-bars-sensibilite-2.png obo-trend-bars-sensibilite-2.png indicateur-technique-mt4-obo-trend-bars.png indicateur-technique-mt4-obo-trend-bars.png
    #136724 quote
    Nicolas
    Keymaster
    Master

    Le code fournit n’a rien à avoir avec l’indicateur dont tu parles, il s’agit d’un gestionnaire d’ordres couplés à un money management particulier. Je pense que tu es mal renseigné 🙄

    #244500 quote
    LucasBest
    Participant
    Average

    https://www.centralcharts.com/fr/gm/1-apprendre/7-analyse-technique/26-indicateur-technique/408-indicateur-technique-obo-trend-bars

    Le fichier ci-joint a été téléchargé sur cet page, mais je n’ai pas metatrader pour le tester/l’ouvrir

    obo_trendbars.ex4
    #244507 quote
    robertogozzi
    Moderator
    Master

    Pour effectuer la conversion, vous avez besoin du fichier source (le texte original et lisible du code), tandis que celui que vous avez joint est le fichier exécutable qui ne peut pas être lu.

    Il devrait avoir l’extension mq4 ou mq5.

    LucasBest thanked this post
    #244510 quote
    LucasBest
    Participant
    Average

    Ok. Merci pour le retour

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Indicateur OBO Trend Bars, conversion code mq4 vers prorealtime


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
JPP @jpp Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by LucasBest
1 year ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 06/21/2020
Status: Active
Attachments: 3 files
Logo Logo
Loading...