glen2008
Nuovo forumer
Spero che qualcuno possa aiutarmi. Ho una formula per TS 2000i che mi gira al rovescio e non riesco a sistemarla. In pratica compra quando vorrei che vendesse e viceversa. Probabilmente sto perdendomi in un bicchiere d'acqua ma dopo due giorni di tentativi dispero. Qualcuno può darmi una mano a "rovesciarla"?
la formula è
Inputs: Price(Close), AvgLen(20), StpPnts(10);
Vars: AvgVal(0), BuyStp(0), SellStp(0);
AvgVal = XAverage(Price, AvgLen);
{Buy/Sell Entry Setup}
IF Lowest(Low, 2) > AvgVal AND Low 1 Bar Ago Crosses Above AvgVal AND MarketPosition <> 1 Then Begin
BuyStp = Highest(High, 2) + StpPnts Points;
Condition1 = True;
End;
IF Highest(High, 2) < AvgVal AND High 1 Bar Ago Crosses Below AvgVal AND MarketPosition <> -1 Then Begin
SellStp = Lowest(Low, 2) - StpPnts Points;
Condition2 = True;
End;
{Buy/Sell Entry Orders}
IF Lowest(Low, 2) > AvgVal AND Condition1 Then
Buy Next Bar at BuyStp Stop;
IF Highest(High, 2) < AvgVal AND Condition2 Then
Sell Next Bar at SellStp Stop;
{Long/Short Exits}
ExitLong Next Bar at AvgVal Stop;
ExitShort Next Bar at AvgVal Stop;
IF MarketPosition <> 0 Then Begin
Condition1 = False;
Condition2 = False;
End;
la formula è
Inputs: Price(Close), AvgLen(20), StpPnts(10);
Vars: AvgVal(0), BuyStp(0), SellStp(0);
AvgVal = XAverage(Price, AvgLen);
{Buy/Sell Entry Setup}
IF Lowest(Low, 2) > AvgVal AND Low 1 Bar Ago Crosses Above AvgVal AND MarketPosition <> 1 Then Begin
BuyStp = Highest(High, 2) + StpPnts Points;
Condition1 = True;
End;
IF Highest(High, 2) < AvgVal AND High 1 Bar Ago Crosses Below AvgVal AND MarketPosition <> -1 Then Begin
SellStp = Lowest(Low, 2) - StpPnts Points;
Condition2 = True;
End;
{Buy/Sell Entry Orders}
IF Lowest(Low, 2) > AvgVal AND Condition1 Then
Buy Next Bar at BuyStp Stop;
IF Highest(High, 2) < AvgVal AND Condition2 Then
Sell Next Bar at SellStp Stop;
{Long/Short Exits}
ExitLong Next Bar at AvgVal Stop;
ExitShort Next Bar at AvgVal Stop;
IF MarketPosition <> 0 Then Begin
Condition1 = False;
Condition2 = False;
End;