{
//---
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 positionsif(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
}
}
{
//---
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 positionsif(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
}
}
自動で設定される水平線の別、ストップリミット、プロフィットが足りないと思う。
ということで、さらに4行。8
自動で設定される水平線の別、ストップリミット、プロフィットが足りないと思う。
ということで、さらに4行。8
#property version "1.11"
水平方向の損切りラインを設定し、価格が正しい方向に移動したらポジションをクローズします。
黄色い線はStopLossとtrawlの同時表示
何pipsでポジションを閉じるかを設定する必要があります。
は、何pipsでポジションを閉じるかを設定する必要があります。
このエラーが発生し、ポジションを開く とExpert Advisorが削除されます。口座は500GLDです。
まだ解けないんです。
このエラーが発生し、ポジションを開く とExpert Advisorが削除されます。口座は500GLDです。
まだ解けないんです。
このエラーは何ですか?
2019.10.28 10:21:58.667 あなたの知能(USDJPY,H1) 'Your intelligence.mq5' (1481,14) でゼロディバイド。
このエラーが発生し、ポジションを開く とExpert Advisorが削除されます。口座は500GLDです。
しかし、ルーブルの口座では、すべてがうまくいくのです。
コード内の1481行目、14の位置 - エラーを探します。
コードの1481行目、カーソル位置14 - エラーを探します。
ありがとうございました!原因がわかったような気がします。ありがとうございました。
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と表示され、変化しないので
チャート上で価格が動くので、そのためかエラーが発生しました。
ここで、私は失敗しました。
{ //--- 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が処理します。