指定


double CalculateProfitOneLot(double entry_price,double exit_price) { double profit=0; if(!OrderCalcProfit(ORDER_TYPE_BUY,Symbol(),1.0,entry_price,exit_price,profit)) { Print(__FUNCTION__," Failed to calculate OrderCalcProfit(). Error ",GetLastError()); } return(profit); }

#define EXPERT_MAGIC 123456  // MagicNumber of the expert
//+------------------------------------------------------------------+
//| Modification of pending orders                                   |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- declare and initialize the trade request and result of trade request
   MqlTradeRequest request={0};
   MqlTradeResult  result={0};
   int total=OrdersTotal(); // total number of placed pending orders
//--- iterate over all placed pending orders
   for(int i=0; i<total; i++)
     {
      //--- parameters of the order
      ulong  order_ticket=OrderGetTicket(i);                             // order ticket
      string order_symbol=Symbol();                                      // symbol
      int    digits=(int)SymbolInfoInteger(order_symbol,SYMBOL_DIGITS);  // number of decimal places
      ulong  magic=OrderGetInteger(ORDER_MAGIC);                         // MagicNumber of the order
      double volume=OrderGetDouble(ORDER_VOLUME_CURRENT);                // current volume of the order
      double sl=OrderGetDouble(ORDER_SL);                                // current Stop Loss of the order
      double tp=OrderGetDouble(ORDER_TP);                                // current Take Profit of the order
      ENUM_ORDER_TYPE type=(ENUM_ORDER_TYPE)OrderGetInteger(ORDER_TYPE); // type of the order
      int offset = 50;                                                   // offset from the current price to place the order, in points
      double price;                                                      // order triggering price
      double point=SymbolInfoDouble(order_symbol,SYMBOL_POINT);          // value of point
      //--- output information about the order
      PrintFormat("#%I64u %s  %s  %.2f  %s  sl: %s  tp: %s  [%I64d]",
                  order_ticket,
                  order_symbol,
                  EnumToString(type),
                  volume,
                  DoubleToString(PositionGetDouble(POSITION_PRICE_OPEN),digits),
                  DoubleToString(sl,digits),
                  DoubleToString(tp,digits),
                  magic);
      //--- if the MagicNumber matches, Stop Loss and Take Profit are not defined
      if(magic==EXPERT_MAGIC && sl==0 && tp==0)
        {
         request.action=TRADE_ACTION_MODIFY;                           // type of trade operation
         request.order = OrderGetTicket(i);                            // order ticket
         request.symbol   =Symbol();                                   // symbol
         request.deviation=5;                                          // allowed deviation from the price
        //--- setting the price level, Take Profit and Stop Loss of the order depending on its type
         if(type==ORDER_TYPE_BUY_LIMIT)
           {
            price = SymbolInfoDouble(Symbol(),SYMBOL_ASK)-offset*point; 
            request.tp = NormalizeDouble(price+offset*point,digits);
            request.sl = NormalizeDouble(price-offset*point,digits);
            request.price    =NormalizeDouble(price,digits);                // normalized opening price
           }
         else if(type==ORDER_TYPE_SELL_LIMIT)
           {
           price = SymbolInfoDouble(Symbol(),SYMBOL_BID)+offset*point; 
            request.tp = NormalizeDouble(price-offset*point,digits);
            request.sl = NormalizeDouble(price+offset*point,digits);
            request.price    =NormalizeDouble(price,digits);                 // normalized opening price
           }
         else if(type==ORDER_TYPE_BUY_STOP)
           {
           price = SymbolInfoDouble(Symbol(),SYMBOL_BID)+offset*point; 
            request.tp = NormalizeDouble(price+offset*point,digits);
            request.sl = NormalizeDouble(price-offset*point,digits);
            request.price    =NormalizeDouble(price,digits);                 // normalized opening price
           }
         else if(type==ORDER_TYPE_SELL_STOP)
           {
           price = SymbolInfoDouble(Symbol(),SYMBOL_ASK)-offset*point; 
            request.tp = NormalizeDouble(price-offset*point,digits);
            request.sl = NormalizeDouble(price+offset*point,digits);
            request.price    =NormalizeDouble(price,digits);                 // normalized opening price
           }
         //--- send the request
         if(!OrderSend(request,result))
            PrintFormat("OrderSend error %d",GetLastError());  // if unable to send the request, output the error code
         //--- information about the operation   
         PrintFormat("retcode=%u  deal=%I64u  order=%I64u",result.retcode,result.deal,result.order);
         //--- zeroing the request and result values
         ZeroMemory(request);
         ZeroMemory(result);
        }
     }
  }
//+------------------------------------------------------------------+

応答済み

1
開発者 1
評価
(12)
プロジェクト
12
25%
仲裁
1
0% / 100%
期限切れ
0
2
開発者 2
評価
(41)
プロジェクト
46
28%
仲裁
9
0% / 100%
期限切れ
7
15%
3
開発者 3
評価
(236)
プロジェクト
440
26%
仲裁
125
21% / 57%
期限切れ
96
22%
仕事中
4
開発者 4
評価
(1)
プロジェクト
1
100%
仲裁
0
期限切れ
0
5
開発者 5
評価
(389)
プロジェクト
416
69%
仲裁
4
75% / 0%
期限切れ
2
0%
取り込み中
6
開発者 6
評価
(33)
プロジェクト
34
65%
仲裁
0
期限切れ
0
7
開発者 7
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
8
開発者 8
評価
(3)
プロジェクト
3
67%
仲裁
1
0% / 0%
期限切れ
0
9
開発者 9
評価
(564)
プロジェクト
933
47%
仲裁
302
59% / 25%
期限切れ
125
13%
取り込み中
10
開発者 10
評価
(66)
プロジェクト
143
34%
仲裁
10
10% / 60%
期限切れ
26
18%
仕事中
類似した注文
I Need An Expert Advisor That Creates Multiple Buy Stop, Buy Limit, Sell Stop And Sell Limit Orders Automatically for example if price reach 2659.22 enter auto buy stop with auto tp and sl
I need an indicator like the one of the two photos that print on current candle 0, or pre alert 60% win rate minimum for mt5 or 4 I would like too trail until Friday as this is when I get paid pls
Nt8 30+ USD
i'm searching a way to define which IP address is using by NT8 cause i'm using a multiple IPs machine (for my daily job) and I'd need to have a further confirmation that I'm using the correct IP address with NT8 could anyone explain explain me how to do it for a fee
I need a developer with FxDreema experience to build an MT5 EA that: Manages recovery zones with pending buy/sell orders. Implements trailing stops, pre-defined profit lines, and dynamic lot sizing. Supports money management based on account balance and lot size and money value. Offers options for continuous or stop trading. The developer must provide the source code and FxDreema link . More specific details will be
Ea already has it way of placing order by putting pending orders when candle open in the direction of the previous candle .All function of the ea should be maintained nothing should change. I want ea should have a compounding order function,which allow ea place multiple pending order in the form of grid with a compounding pips interval function(the distance between two pending orders) in accordance to original ea
I need to create an EA based on my own strategy that actually is a little bit different from most of the usual EA. This because it use an indicator but the power of the system is just because it can shows target price by designing trendline on the price chart in a unusual way. A friend of mine tried to create it on MT4 platform but, in the end, he realized that this platform has big limits when the program lines
This is a 2000 lines own-made breakout EA that I need to have cleanly converted from mql4 to mql5 for learning purposes The start() is about 400 lines long ; basic breakout with specific features , built for Index CFDs with 2 digits (typically DAX or SP500; TP SL... are expressed in actual Points) The Ontester() is about 400 lines (contains 58 different custom opimizations) The Deinit() is about 150 lines The
I'm looking for an MQL5 expert to develop a trading EA that uses the ratio of candle wicks to body sizes to automatically enter and exit trades. Key features should include: - Autopilot function: The EA should handle trade entries without manual intervention. Trade exits are only by hitting trailing SL. - Trade criteria: Trades should only be placed based on specific, pre-defined ratios of candle wicks to body sizes
Convert my tradingview pine script to mt4, Its a simple and straight code i need an expert programmer to convert my tradingview pine script to mt4, Thats All Thank you
Hello, i would like to have a fix on my plotted lines I use a liquidity strategy on the 1 hr time frame but the indicator that i am using for plotting the 1 hr lines is having a issue and printing the plot lines all over the place on the current 1 and 4 hr plot line as you can see in the screenshot this is very disturbing while i am trading can u fix that or just remove the current 1 hr plot line ?and or only show

プロジェクト情報

予算
30 - 200 USD
開発者用
27 - 180 USD
締め切り
最高 10 日