PureBytes Links
Trading Reference Links
|
To List:
Shown below is the solution I found to StopLoss stops and ProfitTarget stops
on the ENTRYBAR for TS6.
TS6 works differently than TS2000i in this regard.
Regards,
Barry Silberman
========================================================================
{example of entrybar code for stop loss, and use of ProfitTargests for TS6:
A) Can use code for "Position" as a whole or on a "Contract/share" basis
1- "SetStopPosition" is used for "Position" as a whole
2- "SetStopContract" is used for "Contract/share" basis
B) If you use "SetStopPosition":
1- amount in "Set ProfitTarget" is a DOLLAR amount profit for entire
position.
2- amount in "SetStopLoss" is a DOLLAR amount loss for entire position.
C) If you use "SetStopContract":
1- amount in "Set ProfitTarget" is a DOLLAR amount profit per
contract/share.
2- amount in "SetStopLoss" is a DOLLAR amount loss per contract/share.
D) Evidently cannot use both a "ProfitTarget" and a "StopLoss" on Entrybar,
since program can't tell
which stop would be hit first. It seems to assume the "ProfitTarget" is
hit first, which isn't very
conservative for testing.
E) Suggest using the "StopLoss" only on ENTRYBAR, and the "ProfitTarget"
starting on the next bar.
F) The use of "If MarketPosition <> 0 then begin" causes stop to appear on
next bar or later
G) If one does NOT USE "If MarketPosition <> 0 then begin" then stop can
appear on entry bar}
Inputs: StopDollarValue(40), ProfitDollarValue(100);
{to set "ProfitTarget" to start on bar after entrybar}
If MarketPosition <> 0 then begin
SetStopContract;
SetProfitTarget(ProfitDollarValue);
end;
{to set "StopLoss" to start on ENTRYBAR}
setstopcontract;
setstoploss(StopDollarValue);
|