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

削除済み  

自動で設定される水平線の別、ストップリミット、プロフィットが足りないと思う。

ということで、さらに4行。8

撮影者

削除済み  
Aleksandr Klapatyuk:

自動で設定される水平線の別、ストップリミット、プロフィットが足りないと思う。

ということで、さらに4行。8


#property version "1.11"

水平方向の損切りラインを設定し、価格が正しい方向に移動したらポジションをクローズします。

黄色い線はStopLossとtrawlの同時表示

トロール

input string   t1="------ TakeProfit    ----------";    // TakeProfit
input double   InTakeProfit            = 54;            // Take Profit, in pips (1.00045-1.00055=1 pips)

何pipsでポジションを閉じるかを設定する必要があります。

撮影者

スナップショット1

は、何pipsでポジションを閉じるかを設定する必要があります。

ファイル:
削除済み  
2019.10.28 10:21:58.667 Your intelligence (USDJPY,H1)   zero divide in 'Your intelligence.mq5' (1481,14)

このエラーが発生し、ポジションを開く とExpert Advisorが削除されます。口座は500GLDです。

まだ解けないんです。

削除済み  
Aleksandr Klapatyuk:

このエラーが発生し、ポジションを開く とExpert Advisorが削除されます。口座は500GLDです。

まだ解けないんです。

このエラーは何ですか?

2019.10.28 10:21:58.667 あなたの知能(USDJPY,H1) 'Your intelligence.mq5' (1481,14) でゼロディバイド。

撮影者

 
Aleksandr Klapatyuk:

このエラーが発生し、ポジションを開く とExpert Advisorが削除されます。口座は500GLDです。

しかし、ルーブルの口座では、すべてがうまくいくのです。

コード内の1481行目、14の位置 - エラーを探します。

削除済み  
Vladimir Karputov:

コードの1481行目、カーソル位置14 - エラーを探します。

ありがとうございました!原因がわかったような気がします。ありがとうございました。

削除済み  
Vladimir Karputov:

1481行目のコードで、カーソル位置14 - エラーを探します。

ほら~、失敗しちゃった。

  {
//---
   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((PositionGetDouble(POSITION_PROFIT)/PositionGetDouble(POSITION_VOLUME)/
             SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE))/n<-InStopLoss)
            ClosePosition(m_position.Symbol());  // close a position by the specified symbo
        }
  }

に修正しました。この機能はまだ確認していませんが、動作すると思われます。

  {
//---
   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.Commission()+m_position.Swap()+m_position.Profit()/n<-InStopLoss)
            ClosePosition(m_position.Symbol());  // close a position by the specified symbo
        }
  }

改めて、ありがとうございました。健康で!そして最高

削除済み  

今気づいた - ターミナルでどこ - GLDアカウント

ポジションを開いた後、利益が変化しない - 8pipsと表示され、変化しないので

チャート上で価格が動くので、そのためかエラーが発生しました。

インクリッドアルパリ MT5_LI

削除済み  

ここで、私は失敗しました。

  {
//---
   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((PositionGetDouble(POSITION_PROFIT)/PositionGetDouble(POSITION_VOLUME)/
             SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE))/n<-InStopLoss)
            ClosePosition(m_position.Symbol());  // close a position by the specified symbo
        }
  }

これに修正しました。ただ、まだ確認していないのですが、うまくいくはずです。

  {
//---
   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.Commission()+m_position.Swap()+m_position.Profit()/n<-InStopLoss)
            ClosePosition(m_position.Symbol());  // close a position by the specified symbo
        }
  }

残しておくべきなんだ-私が失敗したところを。- それは動作します!そして、私は修正したいように、動作しませんし、/nと削除され、それと。

GLDの口座が原因です。同じターミナルでUSDの口座も開設し、すべてうまくいっています。

削除済み  

ExamplesThanksZigzagColorから水平線を描画するインジケータです。

Expert Advisorの起動 .チャートにiCustom.mq5インジケータをインストールします。

をクリックすると、Expert Advisorが処理します。

オブジェクト iCustom

オブジェ iCustom 2

オブジェ iCustom 3 利益が出るまでこの状態が続く

ファイル: