私が試行錯誤しているアドバイザーの組み立て方 - ページ 53

 

この機能は、損益からポジションをオープン します。

//+------------------------------------------------------------------+
//|                                            Close_Open_Profit.mq5 |
//|                        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"

#define  InpMagic 0
//---
#include <Trade\PositionInfo.mqh>
#include <Trade\Trade.mqh>
#include <Trade\SymbolInfo.mqh>
CPositionInfo  m_position; // trade position object
CTrade         m_trade;    // trading object
CSymbolInfo    m_symbol;   // symbol info object
//---
input double InpLots                      = 0.01;  // Lots
input double TargetTakeProfit             = 10000; // Прибыль
input double TargetStopLoss               = 10000; // Убыток
input bool   Acc                          = false; // Open=true; CloseAll=false;
input string t10="- Buy=false><Sell=true  -----";  //
input bool   ObjRevers                    = false; // BUY=false; SELL=true;
//---
double m_adjusted_point; // point value adjusted for 3 or 5 points
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   if(!m_symbol.Name(Symbol())) // sets symbol name
      return(INIT_FAILED);;
//---
   m_trade.SetExpertMagicNumber(InpMagic);
   m_trade.SetMarginMode();
   m_trade.SetTypeFillingBySymbol(m_symbol.Name());
//--- tuning for 3 or 5 digits
   int digits_adjust=1;
   if(m_symbol.Digits()==3 || m_symbol.Digits()==5)
      digits_adjust=10;
   m_adjusted_point=m_symbol.Point()*digits_adjust;
//--- set default deviation for trading in adjusted points
   m_trade.SetDeviationInPoints(3*digits_adjust);
//---
   ObjectCreate(0,"Buy",OBJ_BUTTON,0,0,0);
   ObjectSetInteger(0,"Buy",OBJPROP_XDISTANCE,ChartGetInteger(0,CHART_WIDTH_IN_PIXELS)-102);
   ObjectSetInteger(0,"Buy",OBJPROP_YDISTANCE,37);
   ObjectSetString(0,"Buy",OBJPROP_TEXT,"Buy");
   ObjectSetInteger(0,"Buy",OBJPROP_BGCOLOR,clrMediumSeaGreen);
//---
   ObjectCreate(0,"Sell",OBJ_BUTTON,0,0,0);
   ObjectSetInteger(0,"Sell",OBJPROP_XDISTANCE,ChartGetInteger(0,CHART_WIDTH_IN_PIXELS)-50);
   ObjectSetInteger(0,"Sell",OBJPROP_YDISTANCE,37);
   ObjectSetString(0,"Sell",OBJPROP_TEXT,"Sell");
   ObjectSetInteger(0,"Sell",OBJPROP_BGCOLOR,clrDarkOrange);
//---
   ObjectCreate(0,"CloseAll",OBJ_BUTTON,0,0,0);
   ObjectSetInteger(0,"CloseAll",OBJPROP_XDISTANCE,ChartGetInteger(0,CHART_WIDTH_IN_PIXELS)-75);
   ObjectSetInteger(0,"CloseAll",OBJPROP_YDISTANCE,57);
   ObjectSetString(0,"CloseAll",OBJPROP_TEXT,"CloseAll");
   ObjectSetInteger(0,"CloseAll",OBJPROP_BGCOLOR,clrMediumVioletRed);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   if(ObjectFind(0,"Buy")==0)
     {
      ObjectDelete(0,"Buy");
     }
   if(ObjectFind(0,"Sell")==0)
     {
      ObjectDelete(0,"Sell");
     }
   if(ObjectFind(0,"CloseAll")==0)
     {
      ObjectDelete(0,"CloseAll");
     }
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   if(AccountInfoDouble(ACCOUNT_PROFIT)<-TargetStopLoss ||
      AccountInfoDouble(ACCOUNT_PROFIT)>=TargetTakeProfit)
     {
      if(!Acc)
        {
         CloseAll();
        }
      if(Acc)
        {
         if(!ObjRevers)
           {
            CloseAll();
            double price=m_symbol.Ask();
            m_trade.PositionOpen(m_symbol.Name(),ORDER_TYPE_BUY,InpLots,price,0.0,0.0);
           }
         if(ObjRevers)
           {
            CloseAll();
            double price=m_symbol.Bid();
            m_trade.PositionOpen(m_symbol.Name(),ORDER_TYPE_SELL,InpLots,price,0.0,0.0);
           }
        }
      PlaySound("ok.wav");
     }
   if(ObjectGetInteger(0,"Buy",OBJPROP_STATE)!=0)
     {
      ObjectSetInteger(0,"Buy",OBJPROP_STATE,0);
      double price=m_symbol.Ask();
      m_trade.PositionOpen(m_symbol.Name(),ORDER_TYPE_BUY,InpLots,price,0.0,0.0);
     }
   if(ObjectGetInteger(0,"Sell",OBJPROP_STATE)!=0)
     {
      ObjectSetInteger(0,"Sell",OBJPROP_STATE,0);
      double price=m_symbol.Bid();
      m_trade.PositionOpen(m_symbol.Name(),ORDER_TYPE_SELL,InpLots,price,0.0,0.0);
     }
   if(ObjectGetInteger(0,"CloseAll",OBJPROP_STATE)!=0)
     {
      ObjectSetInteger(0,"CloseAll",OBJPROP_STATE,0);
      CloseAll();
     }
  }
//+------------------------------------------------------------------+
//| start function                                                   |
//+------------------------------------------------------------------+
void CloseAll(void)
  {
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
        {
         ClosePosition(m_position.Symbol()); // close a position by the specified symbo
        }
  }
//+------------------------------------------------------------------+
//| Close selected position                                          |
//+------------------------------------------------------------------+
void ClosePosition(const string symbol)
  {
   if(InitTrade(symbol))
      m_trade.PositionClose(m_position.Ticket()); // close a position by the specified symbo
   PlaySound("ok.wav");
  }
//+------------------------------------------------------------------+
//| Init trade object                                                |
//+------------------------------------------------------------------+
bool InitTrade(const string symbol)
  {
   if(!m_symbol.Name(symbol)) // sets symbol name
      return(false);
   if(IsFillingTypeAllowed(symbol,SYMBOL_FILLING_FOK))
      m_trade.SetTypeFilling(ORDER_FILLING_FOK);
   else
      if(IsFillingTypeAllowed(symbol,SYMBOL_FILLING_IOC))
         m_trade.SetTypeFilling(ORDER_FILLING_IOC);
      else
         m_trade.SetTypeFilling(ORDER_FILLING_RETURN);
   return(true);
  }
//+------------------------------------------------------------------+
//| Checks if the specified filling mode is allowed                  |
//+------------------------------------------------------------------+
bool IsFillingTypeAllowed(string symbol,int fill_type)
  {
//--- Obtain the value of the property that describes allowed filling modes
   int filling=(int)SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE);
//--- Return true, if mode fill_type is allowed
   return((filling & fill_type)==fill_type);
  }
//+------------------------------------------------------------------+
ファイル:
 
Alexsandr San:

UtilityCommand.mq5でアシスタントインジケータを作りましたが、線が動き、そこからコマンドを設定 することが可能です。SEMで 構築しました


私はhttps://www.mql5.com/ru/code/16269 それがmt4スクリプトであることが判明し、私は作者Alexey Volchanskiyに 感謝します。

PriceLines
PriceLines
  • www.mql5.com
Стандартная сетка графика имеет ряд особенностей, не позволяющих с одного взгляда определить движение цены котировки: шаг сетки динамически меняется при переключении таймфрейма, шаг не привязан к базовым уровням, например к 1.12000, как на скриншоте ниже. Скрипт Price Lines размечает уровни цен на графике и служит дополнением к...
 
Alexsandr San:

https://www.mql5.com/ru/code/16269 このスクリプトはmt4から判明しました 作者のAlexey Volchanskiyに 感謝します

mt4だけでなくmt5用のスクリプトもあります。https://www.mql5.com/ru/code/16262 私はIndicatorでそれをマスターしています。

GBPUSDH4

PriceLines
PriceLines
  • www.mql5.com
Стандартная сетка графика имеет ряд особенностей, не позволяющих с одного взгляда определить движение цены котировки: шаг сетки динамически меняется при переключении таймфрейма, шаг не привязан к базовым уровням, например к 1.12000, как на скриншоте ниже. Скрипт Price Lines размечает уровни цен на графике и служит дополнением к сетке графика...
ファイル:
PriceLines.mq5  11 kb
 
Alexsandr San:

損益計算書機能を変更しました#property version "1.013"

に達すると、すべてを閉じて削除し、開いているすべてのウィンドウを指定されたパターンに変更します。

#property version "1.014"

それでも、Profit from Balanceは必要な機能です - 1つのExpert Advisorが複数のペアで動作する場合。

他のペアに影響を与えることなく、指定されたペアでクローズするために、Profit and Lossを再設計しました。

//+------------------------------------------------------------------+
input string   t="-----  Parameters         -----";              //
input string   Template                     = "ADX";             // Имя шаблона(without '.tpl')
input bool     Inpwithout                   = false;             // Сменить только шаблон (true)
input datetime InpMonday_2                  = D'1970.01.01';     // Dell (00::00 -> off)
input double   TargetProfit                 = 999999.99;         // Цель Баланса(Ваш Баланс + сумма)
input uint     maxLimits                    = 1;                 // Кол-во Позиции Открыть в одну сторону
input double   InpLots                      = 0.01;              // Lots
input int      InpTakeProfit                = 900;               // Take Profit ("0"-No. 5<100)
input double   TargetTakeProfit             = 1000000;           // Прибыль на паре в валюте
input double   TargetStopLoss               = 1000000;           // Убыток на паре в валюте

損益、 1000000設定に金額(例えばあなたの通貨の1単位)を書き込みます - それはあなたの通貨の 100万を取るまで、それはポジションを閉じません

ファイル:
 
Alexsandr San:

#property version "1.014"

それでも、バランスからの利益は必要な機能です - 1 Expert Advisorは、複数のペアで動作する場合。

Profit and Lossをこのペアでクローズし、他のペアに影響を与えないように再設計しました。

P&L機能では、金額(例えばお客様の通貨1単位)を1000000に設定します -お客様の 通貨を 100万通貨取るまでポジションを閉じません

#property version "1.015"

少し固定、この関数(利益と損失) - 1つのペアに、あなたはいくつかのポジションを開くことができますので、1つの方法 - 今、合計金額を閉じます、1つの位置がプラスとマイナスで他のことができますが、合計金額は、設定で指定された量と等しく なります。

----------------------

以下は、機能Profit & Loss)です。

//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool ProfitOnTick(void)
  {
   bool res=false;
   double level;
   double PROFIT_BUY=0.00;
   double PROFIT_SELL=0.00;
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name())
           {
            if(m_position.PositionType()==POSITION_TYPE_BUY)
              {
               PROFIT_BUY=PROFIT_BUY+PositionGetDouble(POSITION_PROFIT);
               if(PROFIT_BUY<-TargetStopLoss || PROFIT_BUY>=TargetTakeProfit) // if the profit
                  if(FreezeStopsLevels(level))
                     ClosePositions(POSITION_TYPE_BUY,level);
              }
            else
               if(m_position.PositionType()==POSITION_TYPE_SELL)
                 {
                  PROFIT_SELL=PROFIT_SELL+PositionGetDouble(POSITION_PROFIT);
                  if(PROFIT_SELL<-TargetStopLoss || PROFIT_SELL>=TargetTakeProfit) // if the profit
                     if(FreezeStopsLevels(level))
                        ClosePositions(POSITION_TYPE_SELL,level);
                 }
            res=true;
           }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
ファイル:
 
Alexsandr San:

#property version "1.015"

固定(Profit & Loss)-1つの通貨ペアで複数のポジションを建てることができ、合計金額で決済されます。あるポジションが利益を上げ、別のポジションがマイナスになることがありますが、合計金額は設定で指定した金額と同じに なります。

----------------------

以下は、関数Profit and Loss)です。

実際の口座で試したところ、2つの建玉を 小さく利食いしたかったので、160に設定して、一番大きなマイナスポジションを決済してくれると思っていたのですが、そうではありませんでした。

一番負けているポジションを決済するのかと思ったらそうではなく、160の利益が出た方を決済し、両方のポジションを決済してしまい、私はカモにされました。最初のオープンポジションから、マイナスポジションを足して計算しなければならないことが判明しました

撮影者

スナップショット2

 
Alexsandr San:

#property version "1.015"

固定(Profit & Loss)-1つの通貨ペアで複数のポジションを建てることができ、合計金額で決済されます。あるポジションが利益を上げ、別のポジションがマイナスになることがありますが、合計金額は設定で指定した金額と同じに なります。

----------------------

以下はその機能ですProfit & Loss)。

#property version "1.016"

いろいろな方法を試しましたが、これしかないようです。金額を一度に設定すると、多くのポジションを建てた場合、同じ金額で決済されます。

以下は、この機能を少し変えたものです。

//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool ProfitOnTick(void)
  {
   bool res=false;
   double level;
   double PROFIT_BUY=0.00;
   double PROFIT_SELL=0.00;
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name())
           {
            if(m_position.PositionType()==POSITION_TYPE_BUY)
              {
               PROFIT_BUY=PROFIT_BUY+m_position.Commission()+m_position.Swap()+m_position.Profit();
               if(PROFIT_BUY<-TargetStopLoss || PROFIT_BUY>=TargetTakeProfit) // if the profit
                  if(FreezeStopsLevels(level))
                     ClosePositions(POSITION_TYPE_BUY,level);
              }
            else
               if(m_position.PositionType()==POSITION_TYPE_SELL)
                 {
                  PROFIT_SELL=PROFIT_SELL+m_position.Commission()+m_position.Swap()+m_position.Profit();
                  if(PROFIT_SELL<-TargetStopLoss || PROFIT_SELL>=TargetTakeProfit) // if the profit
                     if(FreezeStopsLevels(level))
                        ClosePositions(POSITION_TYPE_SELL,level);
                 }
            res=true;
           }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
ファイル:
 
Alexsandr San:

#property version "1.016"

いろいろと試しましたが、これしかないでしょう。一度に設定すると、多くのポジションを建てた場合、その金額で決済されます。

以下は、少し変わった機能です。

テスターでこの機能を確認しました。利益300、損失10000に設定しました。 オープンはEURUSD H1のインディケータ(LeMan_BrainTrend1Sig)から、レバレッジ100、0.01ロットのバランスで来ました。

スナップショット.PNG

スナップショット2

通貨の機能利益損失 - BUYとSELLは、同じペアで独自の利益を持っている、(例えば、BUYが利益を 作った場合、それは彼らのポジションを閉じます、それは利益を作ったまで、SELLは閉じません)

 
Alexsandr San:

テスターで確認したところ、利益300、損失10000とし、EURUSD H1、残高100、レバレッジ100、ロット0.01でインジケーター(LeManBrainTrend1Sig)を使用してオープンしました。

通貨の機能利益損失 - BUYとSELLは、同じペアで自分の利益を持って、(例えば、BUYが利益を作った 場合、それは自分のポジションを閉じます、彼らは自分の利益に到達するまで、SELLは閉じません)

さらに1つの機能が追加されました。端末でリアルタイムに確認すればいいだけなんですけどね。

input  int     limit_total_symbol           = 3;                 // Кол-во Позиции при Убытке
input double   TargetOpenLot                = 1000000;           // Убыток на Позиции Открыть Позицию

今回のバージョンはこんな感じです - テスターにて

//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool OpenLotBuy(void)
  {
   bool res=false;
   double PROFIT_BUY=0.00;
   CloseTikB=iClose(NULL,Period(),0);
   OpenTikB=iOpen(NULL,Period(),0);
//---
   int total=PositionsTotal(); // количество открытых позиций
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name())
           {
            if(total>0)
              {
               ulong position_ticket=PositionGetTicket(total-1); // тикет позиции
              }
            if(total<limit_total_symbol)// количество открытых позиций
              {
               if(OpenTikB<CloseTikB)
                 {
                  if(m_position.PositionType()==POSITION_TYPE_BUY)
                    {
                     PROFIT_BUY=PROFIT_BUY+m_position.Commission()+m_position.Swap()+m_position.Profit();
                     if(PROFIT_BUY<-TargetOpenLot)
                        ExtNeedOpenBuy=true;
                     if(LongObjOpened())
                        return(res);
                    }
                  res=true;
                 }
              }
           }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool OpenLotSell(void)
  {
   bool res=false;
   double PROFIT_SELL=0.00;
   CloseTikS=iClose(NULL,Period(),0);
   OpenTikS=iOpen(NULL,Period(),0);
//---
   int total=PositionsTotal(); // количество открытых позиций
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name())
           {
            if(total>0)
              {
               ulong position_ticket=PositionGetTicket(total-1); // тикет позиции
              }
            if(total<limit_total_symbol)// количество открытых позиций
              {
               if(OpenTikS>CloseTikS)
                 {
                  if(m_position.PositionType()==POSITION_TYPE_SELL)
                    {
                     PROFIT_SELL=PROFIT_SELL+m_position.Commission()+m_position.Swap()+m_position.Profit();
                     if(PROFIT_SELL<-TargetOpenLot)
                        ExtNeedOpenSell=true;
                     if(ShortObjOpened())
                        return(res);
                    }
                  res=true;
                 }
              }
           }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+

撮影者

スナップショット2

ファイル:
 
Alexsandr San:

もう一つの機能が追加されました。ただ、端末でリアルタイムに確認する必要があります。

このバージョンはそうです - テスター再生で

悪くない機能だと思います。あちこちに行って、利益を得て、どうでもよくなってしまうのです。

ショット3.PNG

ショット4

しかし、コードには若干の調整が必要です。 うまくいっています。

//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool CloseLotBuy(void)
  {
   bool res=false;
   double level;
   double PROFIT_BUY=0.00;
   PROFIT_BUY=m_position.Commission()+m_position.Swap()+m_position.Profit();
//---
   if(m_position.Symbol()==m_symbol.Name())
     {
      if(m_position.PositionType()==POSITION_TYPE_BUY)
        {
         if(PROFIT_BUY<-TargetStopLoss || PROFIT_BUY>=TargetTakeProfit)
           {
            if(FreezeStopsLevels(level))
               ClosePositions(POSITION_TYPE_BUY,level);
           }
        }
      res=true;
     }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool CloseLotSell(void)
  {
   bool res=false;
   double level;
   double PROFIT_SELL=0.00;
   PROFIT_SELL=m_position.Commission()+m_position.Swap()+m_position.Profit();
//---
   if(m_position.Symbol()==m_symbol.Name())
     {
      if(m_position.PositionType()==POSITION_TYPE_SELL)
        {
         if(PROFIT_SELL<-TargetStopLoss || PROFIT_SELL>=TargetTakeProfit)
           {
            if(FreezeStopsLevels(level))
               ClosePositions(POSITION_TYPE_SELL,level);
           }
        }
      res=true;
     }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool OpenLotBuy(void)
  {
   bool res=false;
   double PROFIT_BUY=0.00;
   CloseTikB=iClose(NULL,Period(),0);
   OpenTikB=iOpen(NULL,Period(),0);
//---
   int total=PositionsTotal(); // количество открытых позиций
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name())
           {
            if(total>0)
              {
               ulong position_ticket=PositionGetTicket(total-1); // тикет позиции
              }
            if(total<limit_total_symbol)// количество открытых позиций
              {
               if(OpenTikB<CloseTikB)
                 {
                  if(m_position.PositionType()==POSITION_TYPE_BUY)
                    {
                     PROFIT_BUY=PROFIT_BUY+m_position.Commission()+m_position.Swap()+m_position.Profit();
                     if(PROFIT_BUY<-TargetOpenLot)
                       {
                        double price=m_symbol.Ask();
                        for(uint y=0; y<maxLimits; y++)
                          {
                           //--- open position
                           if(m_trade.PositionOpen(m_symbol.Name(),ORDER_TYPE_BUY,InpLots,price,0.0,0.0))
                              printf("Position by %s to be opened",m_symbol.Name());
                           else
                             {
                              printf("Error opening BUY position by %s : '%s'",m_symbol.Name(),m_trade.ResultComment());
                              printf("Open parameters : price=%f,TP=%f",price,0.0);
                             }
                           res=true;
                          }
                       }
                    }
                 }
              }
           }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool OpenLotSell(void)
  {
   bool res=false;
   double PROFIT_SELL=0.00;
   CloseTikS=iClose(NULL,Period(),0);
   OpenTikS=iOpen(NULL,Period(),0);
//---
   int total=PositionsTotal(); // количество открытых позиций
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name())
           {
            if(total>0)
              {
               ulong position_ticket=PositionGetTicket(total-1); // тикет позиции
              }
            if(total<limit_total_symbol)// количество открытых позиций
              {
               if(OpenTikS>CloseTikS)
                 {
                  if(m_position.PositionType()==POSITION_TYPE_SELL)
                    {
                     PROFIT_SELL=PROFIT_SELL+m_position.Commission()+m_position.Swap()+m_position.Profit();
                     if(PROFIT_SELL<-TargetOpenLot)
                       {
                        double price0=m_symbol.Bid();
                        for(uint y=0; y<maxLimits; y++)
                          {
                           if(m_trade.PositionOpen(m_symbol.Name(),ORDER_TYPE_SELL,InpLots,price0,0.0,0.0))
                              printf("Position by %s to be opened",m_symbol.Name());
                           else
                             {
                              printf("Error opening SELL position by %s : '%s'",m_symbol.Name(),m_trade.ResultComment());
                              printf("Open parameters : price=%f,TP=%f",price0,0.0);
                             }
                           res=true;
                          }
                       }
                    }
                 }
              }
           }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
理由: