Rejoindre la communauté
banner_forum
Devenez membre de la plus grande
communauté francophone sur le Forex
Partagez, échangez et apprenez en gagnant des crédits sur votre compte de trading

Petit Travail pouressai de mise en place d'une petite martingale ajustable

  • lefeuvr3

    EASIEST MARTINGALE

    Code
    //+------------------------------------------------------------------+ //| EASIEST_MARTINGALE.mq4 | //| Copyright 2020, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2020, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict extern double martingale =1.1; extern int MagicNumber =22112020; extern string mn="Easiest"; extern double stop_loss = 146; extern double take_profit = 899; extern double LotFactor = 110; int last_bar = 0; double last_profit, last_lot; int last_tip; int start() { //============================================================================ double llots = (AccountBalance() * 0.01 /LotFactor); if( OrdersTotal() == 0 && OrdersHistoryTotal() == 0) llots =/* Lots*/(AccountBalance() * 0.01 /LotFactor); else if( OrdersTotal() == 0&& OrdersHistoryTotal() > 0 ) last_history_profit(); if( last_profit < 0 ) llots = martingale*last_lot; if( last_profit > 0 ) llots = (AccountBalance() * 0.01 /LotFactor); //============================================================================ if (last_bar == Bars) return(0); last_bar = Bars; if (OrdersTotal() == 0) { int ticket1 = (OrderSend(Symbol(), OP_BUY, llots ,Ask, 3, Bid- stop_loss * Point, Bid + take_profit * Point,"Easiest", MagicNumber, 0, Blue)); int ticket2= (OrderSend(Symbol(), OP_SELL, llots ,Bid, 3, Ask+ stop_loss * Point, Ask - take_profit * Point, "Easiest", MagicNumber, 0, Red)); } return(0); } //============================================================================ double last_history_profit() { double cpte_profit = 0; //int Magik_No = -1; if( OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY) ) { if( OrderMagicNumber() == MagicNumber ) { last_profit = OrderProfit(); last_lot = OrderLots(); last_tip = OrderType(); } } return(0); } //============================================================================
    Modifié le 2020-12-15 09:07:00 par lefeuvr3
    lefeuvr3 a joint une image
    petit-travail-pouressai-de-mise-en-place-d-une-petite-martingale-ajustable-12511