Schwellwert Stop

Post Reply
gunnar.s
Posts: 9
Joined: 10 Dec 2015 14:09

Schwellwert Stop

Post by gunnar.s »

Hi,
ich habe mal auf Basis des BETrailStop einen Schwellwert Stop gebaut, der auf dem Eröffnungskurs der Eröffnungsperiode aufsetzt und bei erreichen eines gewissen "Gewinns" einen StopLoss auf Einstand + x zieht. Die Tests sahen ganz gut aus, aber vllt entdeckt ja noch jemand einen Fehler.
Ich benutze es für Forex, deswegen sind die Werte so hoch.

Code: Select all

Express Stop TresholdStop
vars
input $InitialRiskInTicks(0, 10000, 5000);
input $ProfitTriggerInTicks(0, 2000, 200);  //if hit, stop gets its first adjustment
input $InitialProfitOffsetInTicks(0, 30, 15);   //ofset from entryprice

numeric entryPrice, tickSize;
numeric breakEven;


calculation
if true then
begin
  SetIntraPeriodUpdate();   //If this function appears _anywhere_ in the code the stop is calculated at every tick.
  entryPrice = open[BarsSinceEntry()];
  tickSize = TickSize();
end

if MarketPosition() = 1 then //Long position
begin
  breakEven = entryPrice + $ProfitTriggerInTicks * tickSize;
  if Highest(high, BarsSinceEntry()) >= breakEven then
  begin
    SetStopPrice (entryPrice + $InitialProfitOffsetInTicks * tickSize);
  end
  else
  begin
     SetStopPrice(entryPrice - $InitialRiskInTicks * tickSize);
  end     
end
else if MarketPosition() = -1 then  //Short position
begin 
  breakEven = entryPrice - $ProfitTriggerInTicks * tickSize;
  if Lowest (low, BarsSinceEntry()) <= breakEven then
  begin
     SetStopPrice (entryPrice - $InitialProfitOffsetInTicks * tickSize);
  end
  else
  begin
     SetStopPrice(entryPrice + $InitialRiskInTicks * tickSize);
  end
concentus
Posts: 10
Joined: 11 Jun 2016 08:29

Re: Schwellwert Stop

Post by concentus »

Wie und wo hast Du den Programmiert?
concentus
Posts: 10
Joined: 11 Jun 2016 08:29

Re: Schwellwert Stop

Post by concentus »

Hi,

Frage wo bzw. wie hast Du das Programiert, oder die Werte abgeändert?
concentus wrote:Wie und wo hast Du den Programmiert?
Post Reply

Return to “WHS NANOTRADER - EXPRESS PROGRAMMING”