コーディングの方法は? - ページ 102 1...9596979899100101102103104105106107108109...347 新しいコメント payback 2008.06.10 14:26 #1011 この件について、もっと詳しく説明してください。 また、私はbooleanとif()を試してみましたが、一見してうまくいきませんでした。 IN10TION 2008.06.10 14:55 #1012 もっと見ないと、もっと説明できない...。 でも、基本は守らないと...。 double a=iCustom(indiA)です。 double b=iCustum(indiB)です。 double c=iCustom(indiC)です。 int ORDer=0; if( a==1 && b>0 && c!=0 ) ORDer=1; if( a==-1 && b<0 && c!=0 ) ORDer=-1。 if(ORDer==1) BUY(); if(ORDer==-1) SELL()です。 payback: 私はブーリアンやif()を試してみましたが、初見では動作しませんでした。 payback 2008.06.10 16:03 #1013 OK OK OK! ここにもっとある! double BuyValueCurrent, SellValuePrevious, SellValueCurrent, BuyValuePrevious2, BuyValueCurrent2, SellValuePrevious2, SellValueCurrent2, BuyValueCurrent1min, BuyValueCurrent5min, BuyValueCurrent21min, BuyValueCurrent25min, SellValueCurrent1min, SellValueCurrent5min, SellValueCurrent21min, SellValueCurrent25min, TrendEnvUp, TrendEnvDown, TrendEnvUp1min, TrendEnvUp5min, TrendEnvDown1min, TrendEnvDown5min, Compra, Vendi, StopLong, StopSell; [/php] the icustom funcions and buy sell BuyValuePrevious = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,0,2); BuyValueCurrent = iCustom(NULL,0,IndicatorName1,NumBars,1,0); BuyValuePrevious2 = iCustom(NULL,TimeFrame,IndicatorName2,NumBars,0,2); BuyValueCurrent2 = iCustom(NULL,0,IndicatorName2,NumBars,0,0); SellValuePrevious = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,1,2); SellValueCurrent = iCustom(NULL,0,IndicatorName1,NumBars,0,0); SellValuePrevious2 = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,1,2); SellValueCurrent2 = iCustom(NULL,0,IndicatorName2,NumBars,1,0); BuyValueCurrent1min = iCustom(NULL,1,IndicatorName1,NumBars,1,0); BuyValueCurrent5min = iCustom(NULL,5,IndicatorName1,NumBars,1,0); BuyValueCurrent21min = iCustom(NULL,1,IndicatorName2,NumBars,0,0); BuyValueCurrent25min = iCustom(NULL,5,IndicatorName2,NumBars,0,0); SellValueCurrent1min = iCustom(NULL,1,IndicatorName1,NumBars,0,0); SellValueCurrent5min = iCustom(NULL,5,IndicatorName1,NumBars,0,0); SellValueCurrent21min = iCustom(NULL,1,IndicatorName2,NumBars,1,0); SellValueCurrent25min = iCustom(NULL,5,IndicatorName2,NumBars,1,0); TrendEnvUp = iCustom(NULL,0,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,0,0); // trendenvelopes TrendEnvDown = iCustom(NULL,0,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,1,0); // trendenvelopes TrendEnvUp1min = iCustom(NULL,1,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,0,0); TrendEnvUp5min = iCustom(NULL,5,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,0,0); TrendEnvDown1min = iCustom(NULL,1,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,1,0); TrendEnvDown5min = iCustom(NULL,5,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,1,0); BuyCondition = (BuyValueCurrent !=0 && BuyValueCurrent2 !=0 && TrendEnvUp != EMPTY_VALUE)&& (BuyValueCurrent1min !=0 && BuyValueCurrent21min !=0 && TrendEnvUp1min != EMPTY_VALUE) && (BuyValueCurrent5min !=0 && BuyValueCurrent25min !=0 && TrendEnvUp5min != EMPTY_VALUE) ; SellCondition = (SellValueCurrent !=0 && SellValueCurrent2 !=0 && TrendEnvDown != EMPTY_VALUE)&& (SellValueCurrent1min != 0 && SellValueCurrent21min != 0 && TrendEnvDown1min != EMPTY_VALUE)&& (SellValueCurrent5min != 0 && SellValueCurrent25min != 0 && TrendEnvDown5min != EMPTY_VALUE) ; StopLong = ((SellValueCurrent !=0 && SellValueCurrent2 !=0) || (TrendEnvDown != EMPTY_VALUE)); StopSell = ((BuyValueCurrent !=0 && BuyValueCurrent2 !=0) || (TrendEnvUp != EMPTY_VALUE)); the exit condition [php] StopBuy = (SellValueCurrent !=0 && SellValueCurrent2 !=0 || TrendEnvDown != EMPTY_VALUE); StopSell = (BuyValueCurrent !=0 && BuyValueCurrent2 !=0 || TrendEnvUp != EMPTY_VALUE); How to code? MQL4からMQL5への移植 初心者向け MQL4 言語テクニカルインディケータと組み込み関数 IN10TION 2008.06.10 16:46 #1014 を変更します。 というわけで、すべての条件は false であり、if() 条件が true になるまで false のままです。 double "のStopLongとStopSellを削除して、他の "double "はそのままにしておきます。 これで完了です。 bool BuyCondition=false。 bool SellCondition=false(売り条件)。 bool StopLong=false。 bool StopSell=false。 if((BuyValueCurrent !=0 && BuyValueCurrent2 !=0 && TrendEnvUp !=EMPTY_VALUE) && (BuyValueCurrent1min !=0 && BuyValueCurrent21min !=0 && BuyValueCurrent21min !=0 && BuyValueCurrent2 !=0 && TrendEnvUp1min != EMPTY_VALUE) && (BuyValueCurrent5min !=0 && BuyValueCurrent25min !=0 && TrendEnvUp5min != EMPTY_VALUE)){買い条件=true;}。 if((SellValueCurrent !=0 && SellValueCurrent2 !=0 && TrendEnvDown != EMPTY_VALUE) && (SellValueCurrent1min !=0 && SellValueCurrent21min !=0 && SellValueCurrent21min !=0 && SellValueCurrent2 !=0 && TrendEnvDown !&& (SellValueCurrent1min != 0 && TrendEnvDown1min != EMPTY_VALUE) && (SellValueCurrent5min != 0 && SellValueCurrent25min != 0 && TrendEnvDown5min != EMPTY_VALUE) )){SellCondition=true;}。 if((SellValueCurrent !=0 && SellValueCurrent2 !=0) || (TrendEnvDown != EMPTY_VALUE)) {StopLong=true;} {StopLong=true;} {SellValueCurrent2 !=0 && SellValueCurrent3 ? if((BuyValueCurrent !=0 && BuyValueCurrent2 !=0) || (TrendEnvUp != EMPTY_VALUE)) {StopSell=true;} {StopSell=true? payback: OK OK OK! ここにもあります! double BuyValueCurrent, SellValuePrevious, SellValueCurrent, BuyValuePrevious2, BuyValueCurrent2, SellValuePrevious2, SellValueCurrent2, BuyValueCurrent1min, BuyValueCurrent5min, BuyValueCurrent21min, BuyValueCurrent25min, SellValueCurrent1min, SellValueCurrent5min, SellValueCurrent21min, SellValueCurrent25min, TrendEnvUp, TrendEnvDown, TrendEnvUp1min, TrendEnvUp5min, TrendEnvDown1min, TrendEnvDown5min, Compra, Vendi, StopLong, StopSell; [/php]the icustom funcions and buy sell BuyValuePrevious = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,0,2); BuyValueCurrent = iCustom(NULL,0,IndicatorName1,NumBars,1,0); BuyValuePrevious2 = iCustom(NULL,TimeFrame,IndicatorName2,NumBars,0,2); BuyValueCurrent2 = iCustom(NULL,0,IndicatorName2,NumBars,0,0); SellValuePrevious = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,1,2); SellValueCurrent = iCustom(NULL,0,IndicatorName1,NumBars,0,0); SellValuePrevious2 = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,1,2); SellValueCurrent2 = iCustom(NULL,0,IndicatorName2,NumBars,1,0); BuyValueCurrent1min = iCustom(NULL,1,IndicatorName1,NumBars,1,0); BuyValueCurrent5min = iCustom(NULL,5,IndicatorName1,NumBars,1,0); BuyValueCurrent21min = iCustom(NULL,1,IndicatorName2,NumBars,0,0); BuyValueCurrent25min = iCustom(NULL,5,IndicatorName2,NumBars,0,0); SellValueCurrent1min = iCustom(NULL,1,IndicatorName1,NumBars,0,0); SellValueCurrent5min = iCustom(NULL,5,IndicatorName1,NumBars,0,0); SellValueCurrent21min = iCustom(NULL,1,IndicatorName2,NumBars,1,0); SellValueCurrent25min = iCustom(NULL,5,IndicatorName2,NumBars,1,0); TrendEnvUp = iCustom(NULL,0,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,0,0); // trendenvelopes TrendEnvDown = iCustom(NULL,0,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,1,0); // trendenvelopes TrendEnvUp1min = iCustom(NULL,1,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,0,0); TrendEnvUp5min = iCustom(NULL,5,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,0,0); TrendEnvDown1min = iCustom(NULL,1,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,1,0); TrendEnvDown5min = iCustom(NULL,5,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,1,0); BuyCondition = (BuyValueCurrent !=0 && BuyValueCurrent2 !=0 && TrendEnvUp != EMPTY_VALUE)&& (BuyValueCurrent1min !=0 && BuyValueCurrent21min !=0 && TrendEnvUp1min != EMPTY_VALUE) && (BuyValueCurrent5min !=0 && BuyValueCurrent25min !=0 && TrendEnvUp5min != EMPTY_VALUE) ; SellCondition = (SellValueCurrent !=0 && SellValueCurrent2 !=0 && TrendEnvDown != EMPTY_VALUE)&& (SellValueCurrent1min != 0 && SellValueCurrent21min != 0 && TrendEnvDown1min != EMPTY_VALUE)&& (SellValueCurrent5min != 0 && SellValueCurrent25min != 0 && TrendEnvDown5min != EMPTY_VALUE) ; StopLong = ((SellValueCurrent !=0 && SellValueCurrent2 !=0) || (TrendEnvDown != EMPTY_VALUE)); StopSell = ((BuyValueCurrent !=0 && BuyValueCurrent2 !=0) || (TrendEnvUp != EMPTY_VALUE)); the exit condition [php] StopBuy = (SellValueCurrent !=0 && SellValueCurrent2 !=0 || TrendEnvDown != EMPTY_VALUE); StopSell = (BuyValueCurrent !=0 && BuyValueCurrent2 !=0 || TrendEnvUp != EMPTY_VALUE); How to code? payback 2008.06.10 17:16 #1015 ありがとうございます!今晩試してみます。 payback 2008.06.10 17:35 #1016 の中はすべてあなたのコメントなのでしょうか? また、私はまだこのステートメントを使用することができますか? if(SellCondition) { ticket = subOpenOrder(OP_SELL,NewStopLossSell,TakeProfit,TicketComment); // open SELL order subCheckError(ticket,"SELL"); LastTrade = "SELL"; return(0); [/php] or i have to write: [php] if(SellCondition = true) { ticket = subOpenOrder(OP_SELL,NewStopLossSell,TakeProfit,TicketComment); // open SELL order subCheckError(ticket,"SELL"); LastTrade = "SELL"; return(0); forexcel 2008.06.10 18:11 #1017 簡単なeaのコードを書くのに助けが必要、お願いします。 皆さん、こんにちは。 過去に私を助けてくれた皆さんに感謝します。今、私は新しい要求を持っています。 どなたかこのEAのコードを書くのを手伝っていただけませんか? 私のEAはdoji barとinside barをベースにしています。 インサイドバーの場合。 次のバーの高値にBUY-STOP/BUY-LIMITを置く。 次のバーの安値に売りストップ/売りリミットを置く。 明確な説明 インサイドバーはバー0(ゼロ)です。 次のバーは、売買のリミット またはストップを置く場所です。 次のバーは、ロングまたはショートがトリガーされる場所です。 1時間足チャートで、午前9時にインサイドバーがあった場合、午前10時のバーの高値と安値に買いストップまたはリミット、売りストップostlimitを置きます。価格が午前10時のバーより高くなったり低くなったりすれば、午前11時のバーでロングまたはショートがトリガされます。 童子バーの場合。 前のバーの高値に買いストップ/買いリミットを設定します。 売りストップ/売りリミットを直前のバーの安値に設定します。 明確な説明 ドージバーはバー0(ゼロ)です。 前のバーまたは童子バーの前のバーは、高値と安値に買い指値と売り指値を置く場所です。 童子バーの後のバーは、ロングやショートのトリガーとなる場所です。 1時間足チャートで、午前9時に童子バーがあった場合、午前8時のバーの高値と安値に買い指値または売り指値、ostrリミットを設定します。ロングまたはショートは、価格が8時のバーより高くまたは低くなった場合、10時のバーでトリガされます。 ...多分、それはそんなに簡単なことではありません。もしそうなら、私は2週間前にそれをやっていたでしょう。 ありがとうございました。 よろしくお願いします。 forexcel IN10TION 2008.06.10 19:30 #1018 これらはコメントではなく、コードです。 これらは、if()文の一部です。 if(SellCondition){」とします。 ... return(0); if(SellCondition==true){。 ... return(0); } どちらのステートメントもOKです。 しかし、すべてのif()ステートメントが}で閉じていることを確認してください。 で閉じていることを確認してください。 他の例 if(a==b){c=1; d=2; return(0);} といった具合です。 payback: また、{}の中はすべてあなたのコメントなのですか、それとも私が書かなければならないのでしょうか?また、私はまだこのステートメントを使用することができますか? if(SellCondition) { ticket = subOpenOrder(OP_SELL,NewStopLossSell,TakeProfit,TicketComment); // open SELL order subCheckError(ticket,"SELL"); LastTrade = "SELL"; return(0); [/php] or i have to write: [php] if(SellCondition = true) { ticket = subOpenOrder(OP_SELL,NewStopLossSell,TakeProfit,TicketComment); // open SELL order subCheckError(ticket,"SELL"); LastTrade = "SELL"; return(0); payback 2008.06.10 19:56 #1019 あ~、よくわかりました。 大学時代のCを見直したけど、同じだった。 とにかく多くのthxs! IN10TION 2008.06.10 20:49 #1020 いくつかのインジケータを見つけました。 EAもあるのですが、ちょっと試してみたところ、あまり性能が良くないような気がします。 ファイル: inampout.mq4 4 kb insidebar.mq4 3 kb butnakedbartrading_ea.mq4 15 kb 1...9596979899100101102103104105106107108109...347 新しいコメント 取引の機会を逃しています。 無料取引アプリ 8千を超えるシグナルをコピー 金融ニュースで金融マーケットを探索 新規登録 ログイン スペースを含まないラテン文字 このメールにパスワードが送信されます エラーが発生しました Googleでログイン WebサイトポリシーおよびMQL5.COM利用規約に同意します。 新規登録 MQL5.com WebサイトへのログインにCookieの使用を許可します。 ログインするには、ブラウザで必要な設定を有効にしてください。 ログイン/パスワードをお忘れですか? Googleでログイン
この件について、もっと詳しく説明してください。
また、私はbooleanとif()を試してみましたが、一見してうまくいきませんでした。
もっと見ないと、もっと説明できない...。
でも、基本は守らないと...。
double a=iCustom(indiA)です。
double b=iCustum(indiB)です。
double c=iCustom(indiC)です。
int ORDer=0;
if( a==1 && b>0 && c!=0 ) ORDer=1;
if( a==-1 && b<0 && c!=0 ) ORDer=-1。
if(ORDer==1) BUY();
if(ORDer==-1) SELL()です。
私はブーリアンやif()を試してみましたが、初見では動作しませんでした。
OK OK OK!
ここにもっとある!
double
BuyValueCurrent,
SellValuePrevious,
SellValueCurrent,
BuyValuePrevious2,
BuyValueCurrent2,
SellValuePrevious2,
SellValueCurrent2,
BuyValueCurrent1min,
BuyValueCurrent5min,
BuyValueCurrent21min,
BuyValueCurrent25min,
SellValueCurrent1min,
SellValueCurrent5min,
SellValueCurrent21min,
SellValueCurrent25min,
TrendEnvUp,
TrendEnvDown,
TrendEnvUp1min,
TrendEnvUp5min,
TrendEnvDown1min,
TrendEnvDown5min,
Compra,
Vendi,
StopLong,
StopSell;
[/php]
the icustom funcions and buy sell
BuyValuePrevious = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,0,2);
BuyValueCurrent = iCustom(NULL,0,IndicatorName1,NumBars,1,0);
BuyValuePrevious2 = iCustom(NULL,TimeFrame,IndicatorName2,NumBars,0,2);
BuyValueCurrent2 = iCustom(NULL,0,IndicatorName2,NumBars,0,0);
SellValuePrevious = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,1,2);
SellValueCurrent = iCustom(NULL,0,IndicatorName1,NumBars,0,0);
SellValuePrevious2 = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,1,2);
SellValueCurrent2 = iCustom(NULL,0,IndicatorName2,NumBars,1,0);
BuyValueCurrent1min = iCustom(NULL,1,IndicatorName1,NumBars,1,0);
BuyValueCurrent5min = iCustom(NULL,5,IndicatorName1,NumBars,1,0);
BuyValueCurrent21min = iCustom(NULL,1,IndicatorName2,NumBars,0,0);
BuyValueCurrent25min = iCustom(NULL,5,IndicatorName2,NumBars,0,0);
SellValueCurrent1min = iCustom(NULL,1,IndicatorName1,NumBars,0,0);
SellValueCurrent5min = iCustom(NULL,5,IndicatorName1,NumBars,0,0);
SellValueCurrent21min = iCustom(NULL,1,IndicatorName2,NumBars,1,0);
SellValueCurrent25min = iCustom(NULL,5,IndicatorName2,NumBars,1,0);
TrendEnvUp = iCustom(NULL,0,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,0,0); // trendenvelopes
TrendEnvDown = iCustom(NULL,0,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,1,0); // trendenvelopes
TrendEnvUp1min = iCustom(NULL,1,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,0,0);
TrendEnvUp5min = iCustom(NULL,5,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,0,0);
TrendEnvDown1min = iCustom(NULL,1,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,1,0);
TrendEnvDown5min = iCustom(NULL,5,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,1,0);
BuyCondition = (BuyValueCurrent !=0 && BuyValueCurrent2 !=0 && TrendEnvUp != EMPTY_VALUE)&& (BuyValueCurrent1min !=0 && BuyValueCurrent21min !=0 && TrendEnvUp1min != EMPTY_VALUE) && (BuyValueCurrent5min !=0 && BuyValueCurrent25min !=0 && TrendEnvUp5min != EMPTY_VALUE) ;
SellCondition = (SellValueCurrent !=0 && SellValueCurrent2 !=0 && TrendEnvDown != EMPTY_VALUE)&& (SellValueCurrent1min != 0 && SellValueCurrent21min != 0 && TrendEnvDown1min != EMPTY_VALUE)&& (SellValueCurrent5min != 0 && SellValueCurrent25min != 0 && TrendEnvDown5min != EMPTY_VALUE) ;
StopLong = ((SellValueCurrent !=0 && SellValueCurrent2 !=0) || (TrendEnvDown != EMPTY_VALUE));
StopSell = ((BuyValueCurrent !=0 && BuyValueCurrent2 !=0) || (TrendEnvUp != EMPTY_VALUE));
the exit condition
[php]
StopBuy = (SellValueCurrent !=0 && SellValueCurrent2 !=0 || TrendEnvDown != EMPTY_VALUE);
StopSell = (BuyValueCurrent !=0 && BuyValueCurrent2 !=0 || TrendEnvUp != EMPTY_VALUE);
を変更します。
というわけで、すべての条件は false であり、if() 条件が true になるまで false のままです。
double "のStopLongとStopSellを削除して、他の "double "はそのままにしておきます。
これで完了です。![](https://c.mql5.com/forextsd/smiles/wink.png)
bool BuyCondition=false。
bool SellCondition=false(売り条件)。
bool StopLong=false。
bool StopSell=false。
if((BuyValueCurrent !=0 && BuyValueCurrent2 !=0 && TrendEnvUp !=EMPTY_VALUE) && (BuyValueCurrent1min !=0 && BuyValueCurrent21min !=0 && BuyValueCurrent21min !=0 && BuyValueCurrent2 !=0 && TrendEnvUp1min != EMPTY_VALUE) && (BuyValueCurrent5min !=0 && BuyValueCurrent25min !=0 && TrendEnvUp5min != EMPTY_VALUE)){買い条件=true;}。
if((SellValueCurrent !=0 && SellValueCurrent2 !=0 && TrendEnvDown != EMPTY_VALUE) && (SellValueCurrent1min !=0 && SellValueCurrent21min !=0 && SellValueCurrent21min !=0 && SellValueCurrent2 !=0 && TrendEnvDown !&& (SellValueCurrent1min != 0 && TrendEnvDown1min != EMPTY_VALUE) && (SellValueCurrent5min != 0 && SellValueCurrent25min != 0 && TrendEnvDown5min != EMPTY_VALUE) )){SellCondition=true;}。
if((SellValueCurrent !=0 && SellValueCurrent2 !=0) || (TrendEnvDown != EMPTY_VALUE)) {StopLong=true;} {StopLong=true;} {SellValueCurrent2 !=0 && SellValueCurrent3 ?
if((BuyValueCurrent !=0 && BuyValueCurrent2 !=0) || (TrendEnvUp != EMPTY_VALUE)) {StopSell=true;} {StopSell=true?
OK OK OK!
ここにもあります!
double
BuyValueCurrent,
SellValuePrevious,
SellValueCurrent,
BuyValuePrevious2,
BuyValueCurrent2,
SellValuePrevious2,
SellValueCurrent2,
BuyValueCurrent1min,
BuyValueCurrent5min,
BuyValueCurrent21min,
BuyValueCurrent25min,
SellValueCurrent1min,
SellValueCurrent5min,
SellValueCurrent21min,
SellValueCurrent25min,
TrendEnvUp,
TrendEnvDown,
TrendEnvUp1min,
TrendEnvUp5min,
TrendEnvDown1min,
TrendEnvDown5min,
Compra,
Vendi,
StopLong,
StopSell;
[/php]the icustom funcions and buy sell
BuyValuePrevious = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,0,2);
BuyValueCurrent = iCustom(NULL,0,IndicatorName1,NumBars,1,0);
BuyValuePrevious2 = iCustom(NULL,TimeFrame,IndicatorName2,NumBars,0,2);
BuyValueCurrent2 = iCustom(NULL,0,IndicatorName2,NumBars,0,0);
SellValuePrevious = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,1,2);
SellValueCurrent = iCustom(NULL,0,IndicatorName1,NumBars,0,0);
SellValuePrevious2 = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,1,2);
SellValueCurrent2 = iCustom(NULL,0,IndicatorName2,NumBars,1,0);
BuyValueCurrent1min = iCustom(NULL,1,IndicatorName1,NumBars,1,0);
BuyValueCurrent5min = iCustom(NULL,5,IndicatorName1,NumBars,1,0);
BuyValueCurrent21min = iCustom(NULL,1,IndicatorName2,NumBars,0,0);
BuyValueCurrent25min = iCustom(NULL,5,IndicatorName2,NumBars,0,0);
SellValueCurrent1min = iCustom(NULL,1,IndicatorName1,NumBars,0,0);
SellValueCurrent5min = iCustom(NULL,5,IndicatorName1,NumBars,0,0);
SellValueCurrent21min = iCustom(NULL,1,IndicatorName2,NumBars,1,0);
SellValueCurrent25min = iCustom(NULL,5,IndicatorName2,NumBars,1,0);
TrendEnvUp = iCustom(NULL,0,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,0,0); // trendenvelopes
TrendEnvDown = iCustom(NULL,0,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,1,0); // trendenvelopes
TrendEnvUp1min = iCustom(NULL,1,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,0,0);
TrendEnvUp5min = iCustom(NULL,5,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,0,0);
TrendEnvDown1min = iCustom(NULL,1,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,1,0);
TrendEnvDown5min = iCustom(NULL,5,IndicatorName4,Ma_Period,Ma_Shift,Ma_Method,Applied_Price,Deviation,1,0);
BuyCondition = (BuyValueCurrent !=0 && BuyValueCurrent2 !=0 && TrendEnvUp != EMPTY_VALUE)&& (BuyValueCurrent1min !=0 && BuyValueCurrent21min !=0 && TrendEnvUp1min != EMPTY_VALUE) && (BuyValueCurrent5min !=0 && BuyValueCurrent25min !=0 && TrendEnvUp5min != EMPTY_VALUE) ;
SellCondition = (SellValueCurrent !=0 && SellValueCurrent2 !=0 && TrendEnvDown != EMPTY_VALUE)&& (SellValueCurrent1min != 0 && SellValueCurrent21min != 0 && TrendEnvDown1min != EMPTY_VALUE)&& (SellValueCurrent5min != 0 && SellValueCurrent25min != 0 && TrendEnvDown5min != EMPTY_VALUE) ;
StopLong = ((SellValueCurrent !=0 && SellValueCurrent2 !=0) || (TrendEnvDown != EMPTY_VALUE));
StopSell = ((BuyValueCurrent !=0 && BuyValueCurrent2 !=0) || (TrendEnvUp != EMPTY_VALUE));
the exit condition
[php]
StopBuy = (SellValueCurrent !=0 && SellValueCurrent2 !=0 || TrendEnvDown != EMPTY_VALUE);
StopSell = (BuyValueCurrent !=0 && BuyValueCurrent2 !=0 || TrendEnvUp != EMPTY_VALUE);
ありがとうございます!今晩試してみます。
の中はすべてあなたのコメントなのでしょうか?
また、私はまだこのステートメントを使用することができますか?
if(SellCondition)
{
ticket = subOpenOrder(OP_SELL,NewStopLossSell,TakeProfit,TicketComment); // open SELL order
subCheckError(ticket,"SELL");
LastTrade = "SELL";
return(0);
[/php]
or i have to write:
[php]
if(SellCondition = true)
{
ticket = subOpenOrder(OP_SELL,NewStopLossSell,TakeProfit,TicketComment); // open SELL order
subCheckError(ticket,"SELL");
LastTrade = "SELL";
return(0);
簡単なeaのコードを書くのに助けが必要、お願いします。
皆さん、こんにちは。
過去に私を助けてくれた皆さんに感謝します。今、私は新しい要求を持っています。
どなたかこのEAのコードを書くのを手伝っていただけませんか?
私のEAはdoji barとinside barをベースにしています。
インサイドバーの場合。
次のバーの高値にBUY-STOP/BUY-LIMITを置く。
次のバーの安値に売りストップ/売りリミットを置く。
明確な説明
インサイドバーはバー0(ゼロ)です。
次のバーは、売買のリミット またはストップを置く場所です。
次のバーは、ロングまたはショートがトリガーされる場所です。
1時間足チャートで、午前9時にインサイドバーがあった場合、午前10時のバーの高値と安値に買いストップまたはリミット、売りストップostlimitを置きます。価格が午前10時のバーより高くなったり低くなったりすれば、午前11時のバーでロングまたはショートがトリガされます。
童子バーの場合。
前のバーの高値に買いストップ/買いリミットを設定します。
売りストップ/売りリミットを直前のバーの安値に設定します。
明確な説明
ドージバーはバー0(ゼロ)です。
前のバーまたは童子バーの前のバーは、高値と安値に買い指値と売り指値を置く場所です。
童子バーの後のバーは、ロングやショートのトリガーとなる場所です。
1時間足チャートで、午前9時に童子バーがあった場合、午前8時のバーの高値と安値に買い指値または売り指値、ostrリミットを設定します。ロングまたはショートは、価格が8時のバーより高くまたは低くなった場合、10時のバーでトリガされます。
...多分、それはそんなに簡単なことではありません。もしそうなら、私は2週間前にそれをやっていたでしょう。
ありがとうございました。
よろしくお願いします。
forexcel
これらはコメントではなく、コードです。
これらは、if()文の一部です。
if(SellCondition){」とします。
...
return(0);
if(SellCondition==true){。
...
return(0);
}
どちらのステートメントもOKです。
しかし、すべてのif()ステートメントが}で閉じていることを確認してください。
で閉じていることを確認してください。
他の例
if(a==b){c=1; d=2; return(0);} といった具合です。
また、{}の中はすべてあなたのコメントなのですか、それとも私が書かなければならないのでしょうか?
また、私はまだこのステートメントを使用することができますか?
if(SellCondition)
{
ticket = subOpenOrder(OP_SELL,NewStopLossSell,TakeProfit,TicketComment); // open SELL order
subCheckError(ticket,"SELL");
LastTrade = "SELL";
return(0);
[/php]
or i have to write:
[php]
if(SellCondition = true)
{
ticket = subOpenOrder(OP_SELL,NewStopLossSell,TakeProfit,TicketComment); // open SELL order
subCheckError(ticket,"SELL");
LastTrade = "SELL";
return(0);
あ~、よくわかりました。
大学時代のCを見直したけど、同じだった。
とにかく多くのthxs!
いくつかのインジケータを見つけました。
EAもあるのですが、ちょっと試してみたところ、あまり性能が良くないような気がします。