if(OrderSymbol()==Symbol() && OrderMagicNumber()==ID){//Pulls in order that meets the criteria for processing
int num=0;int pos=0;
for(int b=0;b<21;b++){// this (loopB) compares the ticket# of the selected order against the number stored in the ticket array
if(tsTicket==OrderTicket() ){
num++; pos=b;// if ticket numbers match, pos is the position in the array where the trailing data is stored
Print("(",pos,") Ticket ",tsTicket[pos]," found. SL is ",tsPrice[pos]);
break;
}
}
if(num==0){ // if the loopB did not find a matching ticket number it is time to initialize the data
for(int j=0;j<21;j++){
if(tsTicket[j]==0){// this is looking for the earliest instance within the array to store the data
pos=j;
break;
}
}
tsTicket[pos]=OrderTicket();// setting the ticket number
tsok[pos]=false;// this is to determine when trailing kicks in
Print("(",pos,") New ticket initialized = ",tsTicket[pos]);
}
if (OrderType()==OP_SELL) {
if (!tsok[pos] && (OrderOpenPrice()-Ask>=TSactivation*Point || TSactivation==0 ) ) {// if the trailing factor is false, but it has hit the activation point continue
tsPrice[pos]=Ask+TrailPips*Point;// this is the new trailinf stop price
tsok[pos]=true;// it's ok to proceed with trailing stop
if(TrailPips>8){// if this distance from the current price to the new stop, then modify the order.
ModifyStopLoss(Ask+TrailPips*Point);//modifies order
}
}
if (tsok[pos] && Ask+TrailPips*Point < tsPrice[pos] ){//if the position is gaining in profit
tsPrice[pos]=Ask+TrailPips*Point;
if(TrailPips>8){
ModifyStopLoss(Ask+TrailPips*Point);
}
}
if (tsok[pos] && Ask >= tsPrice[pos] ){// if the postion hits the stop price
現在、Holyguy7からのプリセットで2.4をテストしていますが、午前1:00から3つのトレードしかできませんでした(1:10 sell usdcad on daily BAD; 7:29 and 14:29 gbpusd on H1 first 28 pips and second actually loser)。それは正常であるように思われる、誰もが同じ結果を持っていますか?
また、複数のタイムフレームのテストを可能にするために、私は2.6バージョンで3行を変更しました。
1 -
extern int ID。
になります。
extern int ID_BASE=100000; PG_2.6に番号を与えるために(ここでは1)。
SLもTPもない注文は嫌だし、superclose()を使うとTrailingが有効になるまでTPがない。そこで、コンピュータが故障した場合に備えて、(supercloseが設定する前に)最初のtakeprofitを設定しておくのはどうだろうかと尋ねています。というわけで、takeprofitの値を2倍にすることを提案しました。
また、テストプランに開始するために、パラメータは次のとおりです。
ストップロス。10から30?
テイクプロフィット:20〜100?
タイムフレーム:M1 M15 H4 Daily Weekly...
通貨:12 from Holyguy7 selection? 少しスプレッド(<=5)のあるものだけですか?
これらは単なる提案です。OK、言いたいことはわかりました。 それはかなり簡単です。 私は稼働率100%の専用サーバーを使って いるので、そういうことを考えるのがおろそかになっています。
そして、superclose()の注意点です。 TSの価格をチケット番号で追跡する機能があれば、MaxTradesを1以上に設定しても、10pips以下のトレールも可能になると思っていました。
for(int i=0;i<OrdersTotal();i++){
if(OrderSelect(i,SELECT_BY_POS)){
if(OrderSymbol()==Symbol() && OrderMagicNumber()==ID){//Pulls in order that meets the criteria for processing
int num=0;int pos=0;
for(int b=0;b<21;b++){// this (loopB) compares the ticket# of the selected order against the number stored in the ticket array
if(tsTicket==OrderTicket() ){
num++; pos=b;// if ticket numbers match, pos is the position in the array where the trailing data is stored
Print("(",pos,") Ticket ",tsTicket[pos]," found. SL is ",tsPrice[pos]);
break;
}
}
if(num==0){ // if the loopB did not find a matching ticket number it is time to initialize the data
for(int j=0;j<21;j++){
if(tsTicket[j]==0){// this is looking for the earliest instance within the array to store the data
pos=j;
break;
}
}
tsTicket[pos]=OrderTicket();// setting the ticket number
tsok[pos]=false;// this is to determine when trailing kicks in
Print("(",pos,") New ticket initialized = ",tsTicket[pos]);
}
if (OrderType()==OP_SELL) {
if (!tsok[pos] && (OrderOpenPrice()-Ask>=TSactivation*Point || TSactivation==0 ) ) {// if the trailing factor is false, but it has hit the activation point continue
tsPrice[pos]=Ask+TrailPips*Point;// this is the new trailinf stop price
tsok[pos]=true;// it's ok to proceed with trailing stop
if(TrailPips>8){// if this distance from the current price to the new stop, then modify the order.
ModifyStopLoss(Ask+TrailPips*Point);//modifies order
}
}
if (tsok[pos] && Ask+TrailPips*Point < tsPrice[pos] ){//if the position is gaining in profit
tsPrice[pos]=Ask+TrailPips*Point;
if(TrailPips>8){
ModifyStopLoss(Ask+TrailPips*Point);
}
}
if (tsok[pos] && Ask >= tsPrice[pos] ){// if the postion hits the stop price
CloseOrder(2);
Print("Order ",tsTicket[pos]," Closed from TS");
}
}
if (OrderType()==OP_BUY) {// reverse of SELL
if(!tsok[pos] && (Bid-OrderOpenPrice() >= TSactivation*Point || TSactivation==0 ) ) {
tsPrice[pos]=Bid-TrailPips*Point;
tsok[pos]=true;
if(TrailPips>8){
ModifyStopLoss(Bid-TrailPips*Point);
}
}
if (tsok[pos] && Bid-TrailPips*Point > tsPrice[pos] ){
tsPrice[pos]=Bid-TrailPips*Point;
if(TrailPips > 8){
ModifyStopLoss(Bid-TrailPips*Point);
}
}
if (tsok[pos] && Bid <= tsPrice[pos] ){
CloseOrder(1);
Print("Order ",tsTicket[pos]," Closed from TS");
} } } } }
for(i=0;i<21;i++){// this searches the array for ticket numbers that are now obsolete due to an order that has closed
if(tsTicket>0){
bool found=false;
for(b=0;b<OrdersTotal();b++){
OrderSelect(b,SELECT_BY_POS);
if(tsTicket==OrderTicket()){
found=true;
break;
}
}
if(!found){// if there are matching ticket numbers in the trade pool and the array then nothing happens
tsTicket=0;tsPrice=0;tsok=false;// if there is an obolete ticket the the data is reset. And the next new ticket data can occupy this space
Print("Array pos ",i," Cleaned");
} } } }UseCloseがtrueになった後、TPを変更したEAです。 安全のためにTPを2倍にします。 Joさんありがとうございます。
Profit Generator 2.4を試したいと思っていました。 630GMTから一度も取引が成立していないのですが・・・どなたか他の取引を成立させているのでしょうか?TF15 $/CHT, £/$, Euro/$... 基本的には良いEAだと思うので教えてください。
現在のバーの長さがLongBarの値より大きいことが第一の基準なので、トレード数は少なくなります。 下限TFのローソク足を小さくすることをお勧めします。
ok、しかし、初心者として、私は異なるパラメータに上限と下限を与えるために、より経験豊富な人を待つことにします。
現在、Holyguy7からのプリセットで2.4をテストしていますが、午前1:00から3つのトレードしかできませんでした(1:10 sell usdcad on daily BAD; 7:29 and 14:29 gbpusd on H1 first 28 pips and second actually loser)。それは正常であるように思われる、誰もが同じ結果を持っていますか?
また、複数のタイムフレームのテストを可能にするために、私は2.6バージョンで3行を変更しました。
1 -
extern int ID。
になります。
extern int ID_BASE=100000; PG_2.6に番号を与えるために(ここでは1)。
2 - "int Bar; "のすぐ下に次の行を追加しました。
int ID;
3 - init()関数を追加しました。
int init()関数
ID=ID_BASE+Period(); return(0);
}
つまり、日足チャートではマジックナンバーは101440となり、トレードのコメント欄に表示されます。これで、時間枠やパラメータの種類ごとに結果を分析することが容易になります。まだテストしていませんが、うまくいくはずです。
また、特定のチャートでは、乱数ではなく固定されたIDを持つことになります。
また、superclose関数を使用した最初のtakeprofitを追加することができるかもしれません。万が一、コンピュータがクラッシュしたときのために。
追記:投稿する前に削除しなければならない他の変更を加えました。素晴らしいアイデアです。 ただ一つ気をつけなければならないのは、同じペアとTFで異なるテストを実行し、ベースIDを変更する場合です。 私はそれらの変更を加えましたが、1つ小さな変更を加えました。...期間は変数 "期間"(チャートとは異なる)から変更することができますので、私は代わりにこれをやった:ID = ID_BASE+P(); return(0)です。
P()は、プログラムによって使用されている実際の期間を返します。 素晴らしいアイデアですね。他にどのような変更で遊んだのでしょうか?
ここに2.6.2があります。
しかし、私はH1と日足で動いていて、longbar=15を維持しています。
今晩は待つことにしよう。
どなたかテストパラメータ(SLとTP)を提案していただけませんか?
私は主要通貨とM1、M5、M15、H1、H4で時間制限なしを使うつもりです。
前回の投稿から何もしていませんが(gbpusdはまだ負けています)、H1と日足で動かしていて、longbar=15を維持しています。
GBPUSDは日足チャートの方がうまくいくような気がしてきました。
TP: 40
SL: 30
タイムフィルターなし
ロングバー: 10
より信頼できそうです。EURUSDとUSDCHFはH1チャートでロングバーを15に、タイムフィルタをオンにするとうまくいくようです。
このEAで主要な通貨ペ アが私を苦しめるので、私は今奮闘しています。どなたかメジャーな通貨ペアで成功された方はいらっしゃいますか?もしそうなら、あなたの発見を投稿してください。
こんにちは
HolyGUYです。
この新しいEAの今日の進捗はどうなっているのでしょうか?
こんにちは。
HolyGUYです。
この新しいEAの今日の進捗状況はどうでしょうか?昨日から主要通貨 ペアで若干のリトレースメントがありましたね。それでも今週は20%以上上昇し、現在システムは未決済の取引を持っていません。
数時間後に私の結果を掲載します。私はGBPUSDをH1タイムフレームで使っていましたが、他のシステムと同様にD1タイムフレームの方がより信頼性が高いと信じています。またご報告します。