die Streuung der Zufallsvariablen (Preis) aus dem Näherungsmodell (gewünschte Funktion) kann nicht kleiner sein als die Streuung der Zufallsvariablen selbst (Summe der Quadrate von Close[i]-Close[i+1])
"darf nicht weniger sein" - ist dies bereits das Kriterium selbst? Oder handelt es sich nur um eine Aussage des Theorems?
Der Punkt ist, dass sie, soweit ich sie verstehe, in diesem Fall nicht anwendbar ist. Das Kriterium kann verwendet werden, um eine Polynomordnung zu finden, die für die Näherungskurve ausreichend ist. Aber diese Kurve wird sich der Flugbahn annähern. Können Sie sich eine Polynomordnung vorstellen, die das Verhalten der Flugbahn in geglätteter Form wiedergeben würde?
Ein Buch, das ganz auf das Thema der Branche abgestimmt ist (Lösungsfindung). Zusätzlich zu den Statistikproblemen gibt es Beispiele für Berechnungen in Excel, Mathcad und Statistica. In der Megaliste habe ich keine gefunden.
Rosh, könntest du das Inhaltsverzeichnis einscannen? Ich würde es gerne sehen. Es würde sehr lange dauern, sie durch Ozone zu schicken. Aber vielleicht könnten Sie in naher Zukunft eine Rezension des Buches schreiben. Das heißt, was wäre Ihrer Meinung nach nützlich?
Ich habe ein Archiv mit 10 unbearbeiteten Fotos erstellt, aber es war zu groß (über 6 MB), also werde ich es wahrscheinlich später veröffentlichen. Ich habe allerdings eine Seite zu diesem Thema bearbeitet:
Ich habe einen EA gefunden, der mit Regressionskanälen handelt (so steht es da) vom 20.04.05 Ich verwende MQL-II, aber vielleicht braucht es ja jemand. Der Autor ist nicht aufgeführt, ich weiß nicht mehr, woher ich es habe.
/*[[
VC-1hr
Lots := 0.1
Notes := Use in H1 timeframe.
Update on every tick := Yes
Enable Alerts := Yes
Disable alert once hit := No
Lots := 1
Stop Loss := 999
Take Profit := 200
Trailing Stop := 999
]]*/
// ====================================================================================================
// DECLARATION AND ASSIGNMENT
// ====================================================================================================
defines: Risk(1),mm(1),maxTradesPerPair(1);
Inputs : NumberName(1), iPeriod(21), MAShoot(50), DrawVertical(0), DrawText(0), ShowMA(0), LineWeight(1), BarsCount(0);
vars: spread(0),
Slippage(5),
sl(0),tp(0),
mode(0),
lastHigh(0),lastLow(0),lastOpen(0),lastClose(0),
target(0),
entryTS(0),
cnt(0),
first(0),
lotMM(0),
tHour(0),
CurrentTrades(0),
AccountIsMini(False); // See comments near assignment statement below.
Var : shift(0), n_begin(0), n_end(0), n(0), a_(0), b_(0), a1(0), a2(0), a3(0), b1(0);
var : y1(0), y2(0), price(0), BarBegin(100), BarEnd(1);
var : tmp_div_high(0), tmp_div_low(0), stddiv_low(0), stddiv_high(0), tmp_div(0);
var : x_n_up(0), x_n_down(0), x_1_up(0), x_1_down(0);
var : check_upper_chanel(false), color_1(0), color_2(0), name(""), angle(0), ratio(0), ratio_currency(0);
Var : MA(0), value(0), Bars_(170), check_low(false), check_high(false);
Var : save_low(0), save_high(0), save_shift_low(0), save_shift_high(0), save_shift(0);
Var : MAType(0), MAPrice(0);
//================================================================================================================
SetLoopCount(0);
comment("Auto Regression channel");
if BarsCount < 1 then Bars_ = Bars
else Bars_ = BarsCount;
save_low = -1;
save_high = -1;
save_shift_low = -1;
save_shift_high = -1;
check_low = false;
check_high = false;
MAType = MODE_SMA;
MAPrice = PRICE_CLOSE;
if Close[1] > 80 then ratio_currency = 100
else ratio_currency = 10000;
For shift = Bars_-1 Downto 0 Begin
MA = iMAEx(iPeriod, MAType, 0, MAPrice, shift);
if ShowMA then SetIndexValue(shift, MA);
if MA - MAShoot/ratio_currency > Close[shift] then
{
if Close[Shift] < save_low or save_low = -1 then
{
check_low = true;
save_low = close[Shift];
save_shift_low = shift;
};
};
if MA + MAShoot/ratio_currency< Close[shift] then
{
if save_high < Close[Shift] or save_high = -1 then
{
check_high = true;
save_high = close[Shift];
save_shift_high = shift;
};
};
if check_low then
{
if MA + MAShoot/ratio_currency < Close[shift] then
{
check_low = false;
save_low = -1;
};
};
if check_high then
{
if MA - MAShoot/ratio_currency > Close[shift] then
{
check_high = false;
save_high = -1;
};
};
End;
if save_shift_low > save_shift_high then
{
n_begin = save_shift_low;
n_end = save_shift_high;
}
else
{
n_begin = save_shift_high;
n_end = save_shift_low;
};
if n_end = 0 then n_end = 1;
n = (n_begin - n_end + 1);
a1 = 0;
a2 = 0;
a3 = 0;
b1 = 0;
a_ = 0;
b_ = 0;
y1 = 0;
y2 = 0;
tmp_div_high = 0;
tmp_div_low = 0;
tmp_div = 0;
if close[n_begin] < close[n_end] then check_upper_chanel = true
else check_upper_chanel = false;
For shift = n_begin Downto n_end Begin
if check_upper_chanel then price = low[shift]
else price = high[shift];
a1 = a1 + shift*price;
a2 = a2 + shift;
a3 = a3 + price;
b1 = b1 + shift*shift;
End;
b_ = (n*a1 - a2*a3)/(n*b1 - a2*a2);
a_ = (a3 - b_*a2)/n;
y1 = a_ + b_*n_begin;
y2 = a_ + b_*n_end;
MoveObject( "Regression_middle" + NumberName, OBJ_TRENDLINE, Time[n_begin], y1, Time[n_end], y2, yellow, LineWeight, STYLE_SOLID);
For shift = n_begin Downto n_end Begin
if check_upper_chanel then price = low[shift]
else price = high[shift];
tmp_div = tmp_div + (price - (a_ + b_*shift))*(price - (a_ + b_*shift));
End;
stddiv_low = sqrt(tmp_div/n);
stddiv_high = sqrt(tmp_div/n);
x_n_up = y1 + 2*stddiv_high;
x_1_up = y2 + 2*stddiv_high;
x_n_down = y1 - 2*stddiv_low;
x_1_down = y2 - 2*stddiv_low;
if check_upper_chanel then {
color_1 = blue;
color_2 = red;
}else{
color_1 = red;
color_2 = blue;
};
//upper
MoveObject( "Regression_upper" + NumberName, OBJ_TRENDLINE, Time[n_begin], x_n_up, Time[n_end], x_1_up, color_1, LineWeight, STYLE_SOLID);
//lower
MoveObject( "Regression_lower" + NumberName, OBJ_TRENDLINE, Time[n_begin], x_n_down, Time[n_end], x_1_down, color_2, LineWeight, STYLE_SOLID);
if DrawText then
{
name = "Regression_bars_begin" + NumberName;
MoveObject(name, OBJ_TEXT, Time[n_begin], x_n_down, Time[n_begin], x_n_down, red, 1, STYLE_SOLID);
SetObjectText(name, NumberToStr(n_begin,0), "System", 10, White);
name = "Regression_bars_end" + NumberName;
MoveObject(name, OBJ_TEXT, Time[n_end], x_1_up, Time[n_end], x_1_up, red, 1, STYLE_SOLID);
SetObjectText(name, NumberToStr(n_end,0), "System", 10, White);
}else{
DelObject("Regression_bars_end" + NumberName, 0, 0, 0, 0);
DelObject("Regression_bars_begin" + NumberName, 0, 0, 0, 0);
}
if DrawVertical then
{
MoveObject( "Regressin_begin" + NumberName, OBJ_VLINE, Time[n_begin], y1, Time[n_begin], y2, silver, 1, STYLE_DOT);
MoveObject( "Regressin_end" + NumberName, OBJ_VLINE, Time[n_end], y1, Time[n_end], y2, silver, 1, STYLE_DOT);
}else{
DelObject("Regressin_begin" + NumberName, 0, 0, 0, 0);
DelObject("Regressin_end" + NumberName, 0, 0, 0, 0);
}
//================================================================================================================
entryTS = 4 * Point; // Entry trailing stop - points
target = TakeProfit * Point; // Profit target - points
lastHigh = High[1]; // Last bar high
lastLow = Low[1]; // Last bar low
lastOpen = Open[1]; // Last bar open
lastClose = Close[1]; // Last bar close
spread = Ask - Bid; // Spread
// ====================================================================================================
// VALIDATION
// ====================================================================================================
if CurTime - LastTradeTime < 300 Then Exit;
if Bars < 100 or TakeProfit < 10 then Exit;
if IsIndirect(Symbol) = True then Exit;
if TrailingStop < 5 then
{
print("invalid Trailing Stop");
Exit;
};
// ====================================================================================================
// DATE CHOKE - For testing purposes
// ====================================================================================================
if TimeYear(time[0]) < 2004 then Exit;
// ====================================================================================================
// PYRAMIDING - LINEAR
// Money management risk exposure compounding
// ====================================================================================================
AccountIsMini = False; // Change to False for real trading w/ 100k/regular account
// or for all backtesting, since backtests allow
// fractional lots.
// Change to True for real trading w/ mini account
if mm <> 0 then
{
lotMM = Ceil(Balance * risk / 10000) / 10;
if lotMM < 0.1 then lotMM = lots;
if lotMM > 1 then lotMM = Ceil(lotMM);
if AccountIsMini then lotMM = lotMM * 10;
if lotMM > 100 then lotMM = 100;
}
else {
lotMM = Lots; // Change mm to 0 if you want the Lots parameter to be in effect
};
// ====================================================================================================
// OPEN ORDER CHECK -
// Each instance of a script is attached to one currency pair.
// When this check executes, it sets CurrentTrades to 1 so that
// only one trade for this symbol will be open, which is enforced
// by "if CurrentTrades = 0".
// ====================================================================================================
CurrentTrades = 0;
for cnt = 1 to TotalTrades
{
if OrderValue(cnt,VAL_SYMBOL) = Symbol then
{
CurrentTrades = CurrentTrades + 1;
};
};
// ====================================================================================================
// TRADE ENTRY
// ====================================================================================================
if CurrentTrades < maxTradesPerPair then
{
//LONG TRADES ENTRY CRITERIA
if //lastOpen < lastClose and // Last bar bullish, open less than close;
check_upper_chanel = true and // Ask above lastHigh, and SAR less than Ask,
y2 > Close and // then request order.
tHour != TimeHour(time[0]) then
{
tHour=TimeMinute(time[0]);
// Set stoploss to last bar low so that Bid must hit lastLow to exit.
sl = x_1_down - (2 * point);
tp = Ask + target;
SetOrder(OP_BUY,
lotMM,
Bid,
Slippage,
sl,
tp,
LIME);
Exit;
};
//SHORT TRADES ENTRY CRITERIA
if //lastOpen > lastClose and // Last bar bearish, open greater than close;
check_upper_chanel = False and // if Bid below lastLow, and SAR greater than Bid,
y2 < Close and // then request order.
tHour != TimeHour(time[0]) then
{
tHour=TimeMinute(time[0]);
// Set stoploss to last bar high so that Ask must hit lastHigh to exit.
sl = x_1_up + (2 * point);
tp = Bid - target;
SetOrder(OP_SELL,
lotMM,
Ask,
Slippage,
sl,
tp,
RED);
Exit;
};
}; // end of if CurrentTrades < maxTradesPerPair
// ====================================================================================================
// TRAILING STOP UPDATE
// ====================================================================================================
if CurrentTrades = 0 then exit;
for cnt = 1 to TotalTrades
{
if OrderValue(cnt,VAL_SYMBOL) = Symbol then
{
if OrderValue(cnt,VAL_TYPE) = OP_BUY then
{
// If Bid - Open is now higher than entryTS pips profit,
// and the stop loss order is lower than
// entryTS pips below the Bid, then adjust the stop loss part of
// the order to the Bid - entryTS pips
if (Bid - OrderValue(cnt,VAL_OPENPRICE)) > (entryTS) then
{
if OrderValue(cnt,VAL_STOPLOSS) < x_1_down then
{
ModifyOrder(OrderValue(cnt,VAL_TICKET),
OrderValue(cnt,VAL_OPENPRICE),
x_1_down - (2 * point),
OrderValue(cnt,VAL_TAKEPROFIT),
BLUE);
Exit;
};
};
// if Stop Loss > Open Price then Set Takeprofit
if OrderValue(cnt,VAL_STOPLOSS) >= OrderValue(cnt,VAL_OPENPRICE) then
{
ModifyOrder(OrderValue(cnt,VAL_TICKET),
OrderValue(cnt,VAL_OPENPRICE),
OrderValue(cnt,VAL_STOPLOSS),
Ask + TakeProfit * Point,
BLUE);
Exit;
};
}; // end OP_BUY check
if OrderValue(cnt,VAL_TYPE) = OP_SELL then
{
// If Open - Ask is now higher than entryTS pips profit,
// and the stop loss order is higher than
// entryTS pips above the Ask, then adjust the stop loss part of
// the order to Ask + entryTS pips
if (OrderValue(cnt,VAL_OPENPRICE) - Ask) > (entryTS) then
{
if OrderValue(cnt,VAL_STOPLOSS) > x_1_up then
{
ModifyOrder(OrderValue(cnt,VAL_TICKET),
OrderValue(cnt,VAL_OPENPRICE),
x_1_up + (2 * point),
OrderValue(cnt,VAL_TAKEPROFIT),
BLUE);
Exit;
};
};
// if Stop Loss < Open Price then Set Takeprofit
if OrderValue(cnt,VAL_STOPLOSS) <= OrderValue(cnt,VAL_OPENPRICE) then
{
ModifyOrder(OrderValue(cnt,VAL_TICKET),
OrderValue(cnt,VAL_OPENPRICE),
OrderValue(cnt,VAL_STOPLOSS),
Bid - TakeProfit * Point,
BLUE);
Exit;
};
}; // end OP_SELL check
}; // end Symbol check
}; // end for cnt=1 to TotalTrades
Ich habe ein Archiv mit 10 unbearbeiteten Fotos erstellt, aber es war zu groß (über 6 MB), also werde ich es wahrscheinlich später veröffentlichen. Ich habe allerdings eine Seite zu diesem Thema bearbeitet:<br / translate="no">
Die in dem Buch aufgestellten Postulate weisen (soweit ich das aus der veröffentlichten Seite ersehen kann) eine schwerwiegende Ungenauigkeit auf (IMHO: Missverständnis des Wesens des Prozesses). Der Punkt ist, dass der PREIS KEINE FUNKTION DER ZEIT IST. Auf jeden Fall ist es unmöglich, dies schlüssig zu beweisen. In der von mir beschriebenen Erklärung beruht der Ansatz auf der Annahme, dass es unmöglich ist, eine Funktion des Preises zuverlässig zu definieren. Eine weitere Annahme ist, dass der Preis eine Funktion einer Überlagerung von externen Faktoren ist. Wir versuchen, Preisänderungen zu approximieren und sie mit zeitlichen Veränderungen in Beziehung zu setzen, was nicht dasselbe ist. Mit anderen Worten: Die Zeit ist keine unabhängige (variable) Variable, sondern hängt von mehreren Faktoren ab. Es handelt sich um einen internen Zeitpunkt des Systems, zu dem das Ereignis stattfindet. Ein externer Beobachter, der all dies von außen in seinem Koordinatensystem betrachtet, kann völlig falsche Schlüsse ziehen. Ein Beispiel: Wir stehen auf einer Straße und zählen die Anzahl der Autos, die in beide Richtungen vorbeigefahren sind. Natürlich können wir auf der Grundlage einiger Informationen sagen, dass die Anzahl der Autos, die die Strecke passieren, eine Funktion der Zeit ist, aber ist das so? Ich habe extra ein Beispiel genannt, bei dem die Absurdität offensichtlich ist. Hier ist alles etwas komplizierter ;).
Mit freundlichen Grüßen, Vladislav. Viel Glück und glückliche Trends.
"darf nicht weniger sein" - ist dies bereits das Kriterium selbst? Oder handelt es sich nur um eine Aussage des Theorems?
Der Punkt ist, dass sie, soweit ich sie verstehe, in diesem Fall nicht anwendbar ist. Das Kriterium kann verwendet werden, um eine Polynomordnung zu finden, die für die Näherungskurve ausreichend ist. Aber diese Kurve wird sich der Flugbahn annähern. Können Sie sich eine Polynomordnung vorstellen, die das Verhalten der Flugbahn in geglätteter Form wiedergeben würde?
:-)
In der Megaliste habe ich keine gefunden.
Rosh, könntest du das Inhaltsverzeichnis einscannen? Ich würde es gerne sehen. Es würde sehr lange dauern, sie durch Ozone zu schicken. Aber vielleicht könnten Sie in naher Zukunft eine Rezension des Buches schreiben. Das heißt, was wäre Ihrer Meinung nach nützlich?
https://c.mql5.com/mql4/forum/2006/08/soderz.zip
von 1 bis 5
https://c.mql5.com/mql4/forum/2006/08/soderz2.zip
von 6 bis 9
Ich verwende MQL-II, aber vielleicht braucht es ja jemand. Der Autor ist nicht aufgeführt, ich weiß nicht mehr, woher ich es habe.
/*[[ VC-1hr Lots := 0.1 Notes := Use in H1 timeframe. Update on every tick := Yes Enable Alerts := Yes Disable alert once hit := No Lots := 1 Stop Loss := 999 Take Profit := 200 Trailing Stop := 999 ]]*/ // ==================================================================================================== // DECLARATION AND ASSIGNMENT // ==================================================================================================== defines: Risk(1),mm(1),maxTradesPerPair(1); Inputs : NumberName(1), iPeriod(21), MAShoot(50), DrawVertical(0), DrawText(0), ShowMA(0), LineWeight(1), BarsCount(0); vars: spread(0), Slippage(5), sl(0),tp(0), mode(0), lastHigh(0),lastLow(0),lastOpen(0),lastClose(0), target(0), entryTS(0), cnt(0), first(0), lotMM(0), tHour(0), CurrentTrades(0), AccountIsMini(False); // See comments near assignment statement below. Var : shift(0), n_begin(0), n_end(0), n(0), a_(0), b_(0), a1(0), a2(0), a3(0), b1(0); var : y1(0), y2(0), price(0), BarBegin(100), BarEnd(1); var : tmp_div_high(0), tmp_div_low(0), stddiv_low(0), stddiv_high(0), tmp_div(0); var : x_n_up(0), x_n_down(0), x_1_up(0), x_1_down(0); var : check_upper_chanel(false), color_1(0), color_2(0), name(""), angle(0), ratio(0), ratio_currency(0); Var : MA(0), value(0), Bars_(170), check_low(false), check_high(false); Var : save_low(0), save_high(0), save_shift_low(0), save_shift_high(0), save_shift(0); Var : MAType(0), MAPrice(0); //================================================================================================================ SetLoopCount(0); comment("Auto Regression channel"); if BarsCount < 1 then Bars_ = Bars else Bars_ = BarsCount; save_low = -1; save_high = -1; save_shift_low = -1; save_shift_high = -1; check_low = false; check_high = false; MAType = MODE_SMA; MAPrice = PRICE_CLOSE; if Close[1] > 80 then ratio_currency = 100 else ratio_currency = 10000; For shift = Bars_-1 Downto 0 Begin MA = iMAEx(iPeriod, MAType, 0, MAPrice, shift); if ShowMA then SetIndexValue(shift, MA); if MA - MAShoot/ratio_currency > Close[shift] then { if Close[Shift] < save_low or save_low = -1 then { check_low = true; save_low = close[Shift]; save_shift_low = shift; }; }; if MA + MAShoot/ratio_currency< Close[shift] then { if save_high < Close[Shift] or save_high = -1 then { check_high = true; save_high = close[Shift]; save_shift_high = shift; }; }; if check_low then { if MA + MAShoot/ratio_currency < Close[shift] then { check_low = false; save_low = -1; }; }; if check_high then { if MA - MAShoot/ratio_currency > Close[shift] then { check_high = false; save_high = -1; }; }; End; if save_shift_low > save_shift_high then { n_begin = save_shift_low; n_end = save_shift_high; } else { n_begin = save_shift_high; n_end = save_shift_low; }; if n_end = 0 then n_end = 1; n = (n_begin - n_end + 1); a1 = 0; a2 = 0; a3 = 0; b1 = 0; a_ = 0; b_ = 0; y1 = 0; y2 = 0; tmp_div_high = 0; tmp_div_low = 0; tmp_div = 0; if close[n_begin] < close[n_end] then check_upper_chanel = true else check_upper_chanel = false; For shift = n_begin Downto n_end Begin if check_upper_chanel then price = low[shift] else price = high[shift]; a1 = a1 + shift*price; a2 = a2 + shift; a3 = a3 + price; b1 = b1 + shift*shift; End; b_ = (n*a1 - a2*a3)/(n*b1 - a2*a2); a_ = (a3 - b_*a2)/n; y1 = a_ + b_*n_begin; y2 = a_ + b_*n_end; MoveObject( "Regression_middle" + NumberName, OBJ_TRENDLINE, Time[n_begin], y1, Time[n_end], y2, yellow, LineWeight, STYLE_SOLID); For shift = n_begin Downto n_end Begin if check_upper_chanel then price = low[shift] else price = high[shift]; tmp_div = tmp_div + (price - (a_ + b_*shift))*(price - (a_ + b_*shift)); End; stddiv_low = sqrt(tmp_div/n); stddiv_high = sqrt(tmp_div/n); x_n_up = y1 + 2*stddiv_high; x_1_up = y2 + 2*stddiv_high; x_n_down = y1 - 2*stddiv_low; x_1_down = y2 - 2*stddiv_low; if check_upper_chanel then { color_1 = blue; color_2 = red; }else{ color_1 = red; color_2 = blue; }; //upper MoveObject( "Regression_upper" + NumberName, OBJ_TRENDLINE, Time[n_begin], x_n_up, Time[n_end], x_1_up, color_1, LineWeight, STYLE_SOLID); //lower MoveObject( "Regression_lower" + NumberName, OBJ_TRENDLINE, Time[n_begin], x_n_down, Time[n_end], x_1_down, color_2, LineWeight, STYLE_SOLID); if DrawText then { name = "Regression_bars_begin" + NumberName; MoveObject(name, OBJ_TEXT, Time[n_begin], x_n_down, Time[n_begin], x_n_down, red, 1, STYLE_SOLID); SetObjectText(name, NumberToStr(n_begin,0), "System", 10, White); name = "Regression_bars_end" + NumberName; MoveObject(name, OBJ_TEXT, Time[n_end], x_1_up, Time[n_end], x_1_up, red, 1, STYLE_SOLID); SetObjectText(name, NumberToStr(n_end,0), "System", 10, White); }else{ DelObject("Regression_bars_end" + NumberName, 0, 0, 0, 0); DelObject("Regression_bars_begin" + NumberName, 0, 0, 0, 0); } if DrawVertical then { MoveObject( "Regressin_begin" + NumberName, OBJ_VLINE, Time[n_begin], y1, Time[n_begin], y2, silver, 1, STYLE_DOT); MoveObject( "Regressin_end" + NumberName, OBJ_VLINE, Time[n_end], y1, Time[n_end], y2, silver, 1, STYLE_DOT); }else{ DelObject("Regressin_begin" + NumberName, 0, 0, 0, 0); DelObject("Regressin_end" + NumberName, 0, 0, 0, 0); } //================================================================================================================ entryTS = 4 * Point; // Entry trailing stop - points target = TakeProfit * Point; // Profit target - points lastHigh = High[1]; // Last bar high lastLow = Low[1]; // Last bar low lastOpen = Open[1]; // Last bar open lastClose = Close[1]; // Last bar close spread = Ask - Bid; // Spread // ==================================================================================================== // VALIDATION // ==================================================================================================== if CurTime - LastTradeTime < 300 Then Exit; if Bars < 100 or TakeProfit < 10 then Exit; if IsIndirect(Symbol) = True then Exit; if TrailingStop < 5 then { print("invalid Trailing Stop"); Exit; }; // ==================================================================================================== // DATE CHOKE - For testing purposes // ==================================================================================================== if TimeYear(time[0]) < 2004 then Exit; // ==================================================================================================== // PYRAMIDING - LINEAR // Money management risk exposure compounding // ==================================================================================================== AccountIsMini = False; // Change to False for real trading w/ 100k/regular account // or for all backtesting, since backtests allow // fractional lots. // Change to True for real trading w/ mini account if mm <> 0 then { lotMM = Ceil(Balance * risk / 10000) / 10; if lotMM < 0.1 then lotMM = lots; if lotMM > 1 then lotMM = Ceil(lotMM); if AccountIsMini then lotMM = lotMM * 10; if lotMM > 100 then lotMM = 100; } else { lotMM = Lots; // Change mm to 0 if you want the Lots parameter to be in effect }; // ==================================================================================================== // OPEN ORDER CHECK - // Each instance of a script is attached to one currency pair. // When this check executes, it sets CurrentTrades to 1 so that // only one trade for this symbol will be open, which is enforced // by "if CurrentTrades = 0". // ==================================================================================================== CurrentTrades = 0; for cnt = 1 to TotalTrades { if OrderValue(cnt,VAL_SYMBOL) = Symbol then { CurrentTrades = CurrentTrades + 1; }; }; // ==================================================================================================== // TRADE ENTRY // ==================================================================================================== if CurrentTrades < maxTradesPerPair then { //LONG TRADES ENTRY CRITERIA if //lastOpen < lastClose and // Last bar bullish, open less than close; check_upper_chanel = true and // Ask above lastHigh, and SAR less than Ask, y2 > Close and // then request order. tHour != TimeHour(time[0]) then { tHour=TimeMinute(time[0]); // Set stoploss to last bar low so that Bid must hit lastLow to exit. sl = x_1_down - (2 * point); tp = Ask + target; SetOrder(OP_BUY, lotMM, Bid, Slippage, sl, tp, LIME); Exit; }; //SHORT TRADES ENTRY CRITERIA if //lastOpen > lastClose and // Last bar bearish, open greater than close; check_upper_chanel = False and // if Bid below lastLow, and SAR greater than Bid, y2 < Close and // then request order. tHour != TimeHour(time[0]) then { tHour=TimeMinute(time[0]); // Set stoploss to last bar high so that Ask must hit lastHigh to exit. sl = x_1_up + (2 * point); tp = Bid - target; SetOrder(OP_SELL, lotMM, Ask, Slippage, sl, tp, RED); Exit; }; }; // end of if CurrentTrades < maxTradesPerPair // ==================================================================================================== // TRAILING STOP UPDATE // ==================================================================================================== if CurrentTrades = 0 then exit; for cnt = 1 to TotalTrades { if OrderValue(cnt,VAL_SYMBOL) = Symbol then { if OrderValue(cnt,VAL_TYPE) = OP_BUY then { // If Bid - Open is now higher than entryTS pips profit, // and the stop loss order is lower than // entryTS pips below the Bid, then adjust the stop loss part of // the order to the Bid - entryTS pips if (Bid - OrderValue(cnt,VAL_OPENPRICE)) > (entryTS) then { if OrderValue(cnt,VAL_STOPLOSS) < x_1_down then { ModifyOrder(OrderValue(cnt,VAL_TICKET), OrderValue(cnt,VAL_OPENPRICE), x_1_down - (2 * point), OrderValue(cnt,VAL_TAKEPROFIT), BLUE); Exit; }; }; // if Stop Loss > Open Price then Set Takeprofit if OrderValue(cnt,VAL_STOPLOSS) >= OrderValue(cnt,VAL_OPENPRICE) then { ModifyOrder(OrderValue(cnt,VAL_TICKET), OrderValue(cnt,VAL_OPENPRICE), OrderValue(cnt,VAL_STOPLOSS), Ask + TakeProfit * Point, BLUE); Exit; }; }; // end OP_BUY check if OrderValue(cnt,VAL_TYPE) = OP_SELL then { // If Open - Ask is now higher than entryTS pips profit, // and the stop loss order is higher than // entryTS pips above the Ask, then adjust the stop loss part of // the order to Ask + entryTS pips if (OrderValue(cnt,VAL_OPENPRICE) - Ask) > (entryTS) then { if OrderValue(cnt,VAL_STOPLOSS) > x_1_up then { ModifyOrder(OrderValue(cnt,VAL_TICKET), OrderValue(cnt,VAL_OPENPRICE), x_1_up + (2 * point), OrderValue(cnt,VAL_TAKEPROFIT), BLUE); Exit; }; }; // if Stop Loss < Open Price then Set Takeprofit if OrderValue(cnt,VAL_STOPLOSS) <= OrderValue(cnt,VAL_OPENPRICE) then { ModifyOrder(OrderValue(cnt,VAL_TICKET), OrderValue(cnt,VAL_OPENPRICE), OrderValue(cnt,VAL_STOPLOSS), Bid - TakeProfit * Point, BLUE); Exit; }; }; // end OP_SELL check }; // end Symbol check }; // end for cnt=1 to TotalTradesDie in dem Buch aufgestellten Postulate weisen (soweit ich das aus der veröffentlichten Seite ersehen kann) eine schwerwiegende Ungenauigkeit auf (IMHO: Missverständnis des Wesens des Prozesses). Der Punkt ist, dass der PREIS KEINE FUNKTION DER ZEIT IST. Auf jeden Fall ist es unmöglich, dies schlüssig zu beweisen.
In der von mir beschriebenen Erklärung beruht der Ansatz auf der Annahme, dass es unmöglich ist, eine Funktion des Preises zuverlässig zu definieren. Eine weitere Annahme ist, dass der Preis eine Funktion einer Überlagerung von externen Faktoren ist. Wir versuchen, Preisänderungen zu approximieren und sie mit zeitlichen Veränderungen in Beziehung zu setzen, was nicht dasselbe ist. Mit anderen Worten: Die Zeit ist keine unabhängige (variable) Variable, sondern hängt von mehreren Faktoren ab. Es handelt sich um einen internen Zeitpunkt des Systems, zu dem das Ereignis stattfindet. Ein externer Beobachter, der all dies von außen in seinem Koordinatensystem betrachtet, kann völlig falsche Schlüsse ziehen. Ein Beispiel: Wir stehen auf einer Straße und zählen die Anzahl der Autos, die in beide Richtungen vorbeigefahren sind. Natürlich können wir auf der Grundlage einiger Informationen sagen, dass die Anzahl der Autos, die die Strecke passieren, eine Funktion der Zeit ist, aber ist das so? Ich habe extra ein Beispiel genannt, bei dem die Absurdität offensichtlich ist. Hier ist alles etwas komplizierter ;).
Mit freundlichen Grüßen, Vladislav.
Viel Glück und glückliche Trends.