Hilfe bei der Codierung - Seite 25

 

Bitte helfen....

BITTE HILFE....

Gleitender Durchschnitt rote Linie, Neigungsrichtung ist unter Linie

Moving avarage blaue Linie, unter der roten Linie bewegt sich avarege

Preis "Steigung Richtung Linie" Schnittzeit

Alles findet zur gleichen Zeit statt: GIVE AN ALARM INDma_crossover_lines.ex4ma_crossover_lines.mq4

Steigung_Richtung_Linie.ex4CATOR

Bitte helfen Sie

--

UmUt EtİkEr

 

Tägliche, wöchentliche, monatliche Gewinne Funktion erforderlich

Ich habe Probleme mit einigen Kodierung. Ich versuche, einen Indikator zu erstellen, der die täglich geschlossenen Gewinne, die wöchentlich geschlossenen und die monatlich geschlossenen Gewinne anzeigt.

Hat jemand eine Funktion, die die Gewinne aus diesen Zeiträumen berechnen wird?

Beispiel.

Heute geschlossen: 5,3%

Woche geschlossen: 13,7%

Monat geschlossen: 41.3%

Jahr geschlossen: 79.5%

Ich weiß in etwa, was zu tun ist, aber ich habe Probleme, es richtig zu machen. Wenn jemand die entsprechenden Funktionen hat, können Sie mir bitte helfen?

 
Versuchen Sie, dies als Grundlage zu verwenden:
//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

//

//

//

// show statistics

//

//

//

double stat[18];

#define stat.OTodayBuy 0

#define stat.OTodaySell 1

#define stat.OTodayTotal 2

#define stat.OTodayBuyPips 3

#define stat.OTodaySellPips 4

#define stat.OTodayTotalPips 5

#define stat.TodayBuy 6

#define stat.TodaySell 7

#define stat.TodayTotal 8

#define stat.TodayBuyPips 9

#define stat.TodaySellPips 10

#define stat.TodayTotalPips 11

#define stat.TotalBuy 12

#define stat.TotalSell 13

#define stat.TotalTotal 14

#define stat.TotalBuyPips 15

#define stat.TotalSellPips 16

#define stat.TotalTotalPips 17

//

//

//

//

//

void stat.colect()

{

int pointRatio = MathPow(10,Digits%2);

int pipMultiplier = MathPow(10,Digits);

double temp;

//

//

//

//

//

ArrayInitialize(stat,0);

for(int i = 0; i < OrdersTotal(); i++)

{

if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false) break;

if(OrderMagicNumber() != MagicNumber) continue;

if(OrderSymbol() != Symbol()) continue;

if(OrderType()==OP_BUY || OrderType()==OP_SELL)

{

double tempa = OrderProfit()+OrderSwap();

double tempp = 0;

if (OrderType()==OP_BUY)

{

tempp = (Bid-OrderOpenPrice())*pipMultiplier/pointRatio;

stat[stat.OTodayBuy] += tempa;

stat[stat.OTodayBuyPips] += tempp;

}

else

{

tempp = (OrderOpenPrice()-Ask)*pipMultiplier/pointRatio;

stat[stat.OTodaySell] += tempa;

stat[stat.OTodaySellPips] += tempp;

}

}

stat[stat.OTodayTotal] += tempa;

stat[stat.OTodayTotalPips] += tempp;

}

//

//

//

// now check the history

//

//

//

datetime startTime = StrToTime(StringSubstr(TimeToStr(TimeCurrent()),0,10)+" 00:00");

datetime endTime = StrToTime(StringSubstr(TimeToStr(TimeCurrent()),0,10)+" 24:00");

//

//

//

//

//

for(i = 0; i < OrdersHistoryTotal(); i++)

{

if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY) == false) break;

if(OrderMagicNumber() != MagicNumber) continue;

if(OrderSymbol() != Symbol()) continue;

//

//

//

//

//

bool isOutOfToday = (OrderCloseTime()endTime);

if(OrderType()==OP_BUY || OrderType()==OP_SELL)

{

tempa = OrderProfit()+OrderSwap();

tempp = 0;

if (OrderType()==OP_BUY)

{

tempp = (OrderClosePrice()-OrderOpenPrice())*pipMultiplier/pointRatio;

stat[stat.TotalBuy] += tempa;

stat[stat.TotalBuyPips] += tempp;

if (!isOutOfToday)

{

stat[stat.TodayBuy] += tempa;

stat[stat.TodayBuyPips] += tempp;

}

}

else

{

tempp = (OrderOpenPrice()-OrderClosePrice())*pipMultiplier/pointRatio;

stat[stat.TotalSell] += tempa;

stat[stat.TotalSellPips] += tempp;

if (!isOutOfToday)

{

stat[stat.TodaySell] += tempa;

stat[stat.TodaySellPips] += tempp;

}

}

//

//

//

//

//

if (!isOutOfToday)

{

stat[stat.TodayTotal] += tempa;

stat[stat.TodayTotalPips] += tempp;

}

stat[stat.TotalTotal] += tempa;

stat[stat.TotalTotalPips] += tempp;

}

}

}

void showStatistics()

{

if (!showStatistics) return;

//

//

//

//

//

stat.colect();

createLabel( 1,"opened buy profit" ,stat[stat.OTodayBuy] , 10);

createLabel( 2,"opened buy profit (pips)" ,stat[stat.OTodayBuyPips] , 20,0);

createLabel( 3,"opened sell profit" ,stat[stat.OTodaySell] , 30);

createLabel( 4,"opened sell profit (pips)",stat[stat.OTodaySellPips] , 40,0);

createLabel( 5,"opened profit" ,stat[stat.OTodayTotal] , 50);

createLabel( 6,"opened profit (pips)" ,stat[stat.OTodayTotalPips], 60,0);

createLabel( 7,"daily buy profit" ,stat[stat.TodayBuy] , 80);

createLabel( 8,"daily buy profit (pips)" ,stat[stat.TodayBuyPips] , 90,0);

createLabel( 9,"daily sell profit" ,stat[stat.TodaySell] ,100);

createLabel(10,"daily sell profit (pips)" ,stat[stat.TodaySellPips] ,110,0);

createLabel(11,"daily profit" ,stat[stat.TodayTotal] ,120);

createLabel(12,"daily profit (pips)" ,stat[stat.TodayTotalPips] ,130,0);

createLabel(13,"total buy profit" ,stat[stat.TotalBuy] ,150);

createLabel(14,"total buy profit (pips)" ,stat[stat.TotalBuyPips] ,160,0);

createLabel(15,"total sell profit" ,stat[stat.TotalSell] ,170);

createLabel(16,"total sell profit (pips)" ,stat[stat.TotalSellPips] ,180,0);

createLabel(17,"total profit" ,stat[stat.TotalTotal] ,190);

createLabel(18,"total profit (pips)" ,stat[stat.TotalTotalPips] ,200,0);

WindowRedraw();

}

//

//

//

//

//

void createLabel(string lname, string text, double value,int ypos,int decimals=2)

{

string name = "stat."+lname;

if (ObjectFind(name) == -1)

{

ObjectCreate(name,OBJ_LABEL,0,0,0);

ObjectSet(name,OBJPROP_CORNER ,0);

ObjectSet(name,OBJPROP_XDISTANCE,5);

ObjectSet(name,OBJPROP_YDISTANCE,ypos+5);

}

ObjectSetText(name,text,9,"Arial",Gray);

//

//

//

//

//

name = name+"value";

if (ObjectFind(name) == -1)

{

ObjectCreate(name,OBJ_LABEL,0,0,0);

ObjectSet(name,OBJPROP_CORNER ,0);

ObjectSet(name,OBJPROP_XDISTANCE,145);

ObjectSet(name,OBJPROP_YDISTANCE,ypos+5);

}

color theColor = DimGray;

if (value < 0) theColor = Orange;

if (value > 0) theColor = Lime;

ObjectSetText(name,DoubleToStr(value,decimals),9,"Arial",theColor);

}

Sie haben eine geöffnete, tägliche und eine Gesamtstatistik in dieser abgedeckt. Das Hinzufügen von wöchentlichen und monatlichen Statistiken sollte nicht allzu schwierig sein (folgen Sie einfach der Logik der täglichen Datenerfassung).

sbwent:
Ich habe Probleme mit der Kodierung. Ich versuche, einen Indikator zu erstellen, der die täglich geschlossenen Gewinne, die wöchentlich geschlossenen und die monatlich geschlossenen Gewinne anzeigt.

Kennt jemand eine Funktion, mit der die Gewinne aus diesen Zeiträumen berechnet werden können?

z.B..

Heute geschlossen: 5,3%

Woche geschlossen: 13,7%

Monat geschlossen: 41.3%

Jahr geschlossen: 79.5%

Ich weiß irgendwie, was getan werden muss, aber ich habe Probleme, es richtig zu machen. Wenn jemand die Funktionen hat, die dies tun, können Sie mir bitte helfen?
 

Danke, ich werde es ausprobieren.

mladen:
Versuchen Sie, dies als Grundlage zu verwenden:
//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

//

//

//

// show statistics

//

//

//

double stat[18];

#define stat.OTodayBuy 0

#define stat.OTodaySell 1

#define stat.OTodayTotal 2

#define stat.OTodayBuyPips 3

#define stat.OTodaySellPips 4

#define stat.OTodayTotalPips 5

#define stat.TodayBuy 6

#define stat.TodaySell 7

#define stat.TodayTotal 8

#define stat.TodayBuyPips 9

#define stat.TodaySellPips 10

#define stat.TodayTotalPips 11

#define stat.TotalBuy 12

#define stat.TotalSell 13

#define stat.TotalTotal 14

#define stat.TotalBuyPips 15

#define stat.TotalSellPips 16

#define stat.TotalTotalPips 17

//

//

//

//

//

void stat.colect()

{

int pointRatio = MathPow(10,Digits%2);

int pipMultiplier = MathPow(10,Digits);

double temp;

//

//

//

//

//

ArrayInitialize(stat,0);

for(int i = 0; i < OrdersTotal(); i++)

{

if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false) break;

if(OrderMagicNumber() != MagicNumber) continue;

if(OrderSymbol() != Symbol()) continue;

if(OrderType()==OP_BUY || OrderType()==OP_SELL)

{

double tempa = OrderProfit()+OrderSwap();

double tempp = 0;

if (OrderType()==OP_BUY)

{

tempp = (Bid-OrderOpenPrice())*pipMultiplier/pointRatio;

stat[stat.OTodayBuy] += tempa;

stat[stat.OTodayBuyPips] += tempp;

}

else

{

tempp = (OrderOpenPrice()-Ask)*pipMultiplier/pointRatio;

stat[stat.OTodaySell] += tempa;

stat[stat.OTodaySellPips] += tempp;

}

}

stat[stat.OTodayTotal] += tempa;

stat[stat.OTodayTotalPips] += tempp;

}

//

//

//

// now check the history

//

//

//

datetime startTime = StrToTime(StringSubstr(TimeToStr(TimeCurrent()),0,10)+" 00:00");

datetime endTime = StrToTime(StringSubstr(TimeToStr(TimeCurrent()),0,10)+" 24:00");

//

//

//

//

//

for(i = 0; i < OrdersHistoryTotal(); i++)

{

if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY) == false) break;

if(OrderMagicNumber() != MagicNumber) continue;

if(OrderSymbol() != Symbol()) continue;

//

//

//

//

//

bool isOutOfToday = (OrderCloseTime()endTime);

if(OrderType()==OP_BUY || OrderType()==OP_SELL)

{

tempa = OrderProfit()+OrderSwap();

tempp = 0;

if (OrderType()==OP_BUY)

{

tempp = (OrderClosePrice()-OrderOpenPrice())*pipMultiplier/pointRatio;

stat[stat.TotalBuy] += tempa;

stat[stat.TotalBuyPips] += tempp;

if (!isOutOfToday)

{

stat[stat.TodayBuy] += tempa;

stat[stat.TodayBuyPips] += tempp;

}

}

else

{

tempp = (OrderOpenPrice()-OrderClosePrice())*pipMultiplier/pointRatio;

stat[stat.TotalSell] += tempa;

stat[stat.TotalSellPips] += tempp;

if (!isOutOfToday)

{

stat[stat.TodaySell] += tempa;

stat[stat.TodaySellPips] += tempp;

}

}

//

//

//

//

//

if (!isOutOfToday)

{

stat[stat.TodayTotal] += tempa;

stat[stat.TodayTotalPips] += tempp;

}

stat[stat.TotalTotal] += tempa;

stat[stat.TotalTotalPips] += tempp;

}

}

}

void showStatistics()

{

if (!showStatistics) return;

//

//

//

//

//

stat.colect();

createLabel( 1,"opened buy profit" ,stat[stat.OTodayBuy] , 10);

createLabel( 2,"opened buy profit (pips)" ,stat[stat.OTodayBuyPips] , 20,0);

createLabel( 3,"opened sell profit" ,stat[stat.OTodaySell] , 30);

createLabel( 4,"opened sell profit (pips)",stat[stat.OTodaySellPips] , 40,0);

createLabel( 5,"opened profit" ,stat[stat.OTodayTotal] , 50);

createLabel( 6,"opened profit (pips)" ,stat[stat.OTodayTotalPips], 60,0);

createLabel( 7,"daily buy profit" ,stat[stat.TodayBuy] , 80);

createLabel( 8,"daily buy profit (pips)" ,stat[stat.TodayBuyPips] , 90,0);

createLabel( 9,"daily sell profit" ,stat[stat.TodaySell] ,100);

createLabel(10,"daily sell profit (pips)" ,stat[stat.TodaySellPips] ,110,0);

createLabel(11,"daily profit" ,stat[stat.TodayTotal] ,120);

createLabel(12,"daily profit (pips)" ,stat[stat.TodayTotalPips] ,130,0);

createLabel(13,"total buy profit" ,stat[stat.TotalBuy] ,150);

createLabel(14,"total buy profit (pips)" ,stat[stat.TotalBuyPips] ,160,0);

createLabel(15,"total sell profit" ,stat[stat.TotalSell] ,170);

createLabel(16,"total sell profit (pips)" ,stat[stat.TotalSellPips] ,180,0);

createLabel(17,"total profit" ,stat[stat.TotalTotal] ,190);

createLabel(18,"total profit (pips)" ,stat[stat.TotalTotalPips] ,200,0);

WindowRedraw();

}

//

//

//

//

//

void createLabel(string lname, string text, double value,int ypos,int decimals=2)

{

string name = "stat."+lname;

if (ObjectFind(name) == -1)

{

ObjectCreate(name,OBJ_LABEL,0,0,0);

ObjectSet(name,OBJPROP_CORNER ,0);

ObjectSet(name,OBJPROP_XDISTANCE,5);

ObjectSet(name,OBJPROP_YDISTANCE,ypos+5);

}

ObjectSetText(name,text,9,"Arial",Gray);

//

//

//

//

//

name = name+"value";

if (ObjectFind(name) == -1)

{

ObjectCreate(name,OBJ_LABEL,0,0,0);

ObjectSet(name,OBJPROP_CORNER ,0);

ObjectSet(name,OBJPROP_XDISTANCE,145);

ObjectSet(name,OBJPROP_YDISTANCE,ypos+5);

}

color theColor = DimGray;

if (value < 0) theColor = Orange;

if (value > 0) theColor = Lime;

ObjectSetText(name,DoubleToStr(value,decimals),9,"Arial",theColor);

}

Sie haben eine geöffnete, eine tägliche und eine Gesamtstatistik in dieser abgedeckt. Das Hinzufügen von wöchentlichen und monatlichen Daten sollte nicht allzu schwierig sein (folgen Sie einfach der Logik der täglichen Datenerfassung).

Danke, du warst mir eine große Hilfe. Ich werde sehen, ob ich es so hinbekomme.

 

Mtf cci haken

Jungs, kann jemand einen Blick und helfen Sie mir mit beigefügten CCI-Hook-Indikator, fügte ich MTF-Funktion in ihm, aber ich möchte sehen, Punkte horizontal ausgerichtet und ich kann es nicht verwalten ... oder nur ein Punkt von geschlossenen bar der höheren TF.

Ich danke Ihnen im Voraus.

ccihookmtf.mq4

Dateien:
 

...

Versuchen Sie etwas wie das hier. Diese zeigt alle Punkte des Zielzeitrahmens horizontal ausgerichtet

altoronto:
Leute, kann jemand einen Blick darauf werfen und mir mit dem beigefügten CCI-Hook-Indikator helfen, ich habe die MTF-Funktion hinzugefügt, aber ich möchte die Punkte horizontal ausgerichtet sehen, und ich schaffe es nicht ... oder nur einen Punkt vom geschlossenen Balken des höheren TF.

Ich danke Ihnen im Voraus.

ccihookmtf.mq4
Dateien:
 
mladen:
Versuchen Sie etwas wie das hier. Dieses zeigt alle Punkte des Zielzeitrahmens horizontal ausgerichtet

Danke Mladen, du weißt wirklich, wie man Daten quält

 

...

Wenn Sie es auf nur einen Punkt pro Bar des Zielzeitrahmens (in diesem Fall der erste Bar, der zum Bar des Zielzeitrahmens gehört) beschränken wollen, dann könnten Sie etwas tun, wie es in dieser Version gemacht wurde (im Beispiel ist es ein einstündiger cci-Haken auf einem 15-Minuten-Chart - die Option wurde dem Indikator hinzugefügt, damit Sie wählen können)

altoronto:
Danke Mladen, du weißt wirklich, wie man Daten quält
Dateien:
cci_hk.gif  28 kb
 

Hallo Leute

wie kann ich die Zeit des nächsten Taktes erfahren?

Ich habe versucht

datetime Time[-1];

was nicht funktioniert hat

grüßt

 

Zukünftige Taktzeit ....

Versucht es mal so:
datetime futureBarTime = Time[0]+Period()*60;
Deorn:
Hallo Leute

Wie kann ich die Zeit des nächsten Taktes erfahren?

Ich habe versucht

datetime Time[-1];

was nicht funktioniert hat

grüßt