[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Easylanguage coding Problem - Help really appreciated.



PureBytes Links

Trading Reference Links

This code is exactly the same as Wilders system! and have compared it to
the wilder's system (this one just seems a little more robust)

I copied it from a website called

http://klub.chip.pl/tsfp/t-i-Swing_Wave_Indicator.html

I am using TS2000i






                                                                                                                                        
                      "Bill Lumley"                                                                                                     
                      <lumley@xxxxxxxx         To:      "'mark.keenan@xxxxxxxxxxxxxx'" <mark.keenan@xxxxxxxxxxxxxx>                     
                      tworks.com>              cc:                                                                                      
                                               Subject: RE: Easylanguage coding Problem - Help really appreciated.                      
                      30/07/2002 15:22                                                                                                  
                                                                                                                                        
                                                                                                                                        




Mark - Question


What function are you using for SAR and what version of Tradestation ? I am
looking
to develop a system based on SAR and some other things but I understand the
SAR
in TS 2000i at least is not the same of Wilders (he uses high of last N
bars or something
to prevent SAR from whipsawing direction) .


Is VLineUp & VLineDn your SAR function and is it based on Wilders formula's
?


Thanks


-----Original Message-----
From: mark.keenan@xxxxxxxxxxxxxx [mailto:mark.keenan@xxxxxxxxxxxxxx]
Sent: 30 July 2002 11:50
To: omega-list@xxxxxxxxxx
Subject: Easylanguage coding Problem - Help really appreciated.





Firstly sorry about Disclaimer at bottom - can't help it.


How can I get a system to add to a position - For example:


Assume the system is as follows:


- sells 1 contract if the market closes below the 100 day moving average
and buys one contract if the market closes above the 100 day moving
average.


sells further contracts (adds to position) if the market closes above the
10 day moving average whilst in the above trade.


exits all positions if the market closes above the 100 day moving average.


My actual example is as follows: The code is essentially for Wilders
Volatility SAR System (length 21, Factor 3)


I want to code the system to add to the position using a more sensitive
Factor (for example 1.5)  - ie be overall short if the market closes below
the SAR (length 21, Coefficient 3), yet add further shorts to the trade if
the market closes ABOVE the SAR (length 21, Coefficient 1.5)






Code is detailed below:


inputs: Coefficient (3);


Vars:
   VLineUp(0),
   VLineDn(0),
   Highest(0),
   Lowest(0),
   JustChanged(FALSE),
   VLine(0);


Array:
Highs[22](0),
Lows[22](0),
Range[22](0),
UpWave[1](FALSE),
DnWave[1](FALSE);


{MaxBarsBack = 21}


JustChanged = FALSE;


if CurrentBar <= 21 then begin
Highs[CurrentBar] = Close;
Lows[CurrentBar] = Close;
Range[CurrentBar] = (High - Low) /2;
end;


if CurrentBar = 22 then begin
if Highs[21] >= Highs[20] then begin
UpWave[1] = TRUE;
Highest = Highs[21];
VLineUp = Highest - (Coefficient * Average((High - Low),21));
end;


if Highs[21] < Highs[20] then begin
DnWave[1] = TRUE;
Lowest = Lows[21];
VLineDn = Lowest + (Coefficient * Average((High - Low),21));
end;
end;


if CurrentBar > 22 then begin


if DnWave[1] and Close > VLineDn then begin {WAVE CHANGE}
DnWave[1] = FALSE;
UpWave[1] = TRUE;
JustChanged = TRUE;
Highest = Close;
Lowest = 0;
end;


if UpWave[1] and Close < VLineUp and JustChanged = FALSE then begin
{WAVE CHANGE}
UpWave[1] = FALSE;
DnWave[1] = TRUE;
JustChanged = TRUE;
Lowest = Close;
Highest = 0;
end;


if JustChanged = FALSE then begin
if Close > Highest then Highest = Close
else if Close < Lowest then Lowest = Close;
end;


{CALCULATIONS AND PLOT STATMENTS}
VLineUp = Highest - (Coefficient * Average((High - Low),21));
VLineDn = Lowest + (Coefficient * Average((High - Low),21));


if UpWave[1] then buy this bar on close
else if DnWave[1] then sell this bar on close;
end
---------------------------------------------------------------------------

This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender by
return e-mail and delete this message from your system. Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
ABN AMRO Bank N.V. (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in
this communication nor for any delay in its receipt or damage to your
system. ABN AMRO Bank N.V. (or its group companies) does not guarantee that

the integrity of this communication has been maintained nor that this
communication is free of viruses, interceptions or interference.
---------------------------------------------------------------------------













---------------------------------------------------------------------------


This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender by
return e-mail and delete this message from your system. Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.


ABN AMRO Bank N.V. (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in
this communication nor for any delay in its receipt or damage to your
system. ABN AMRO Bank N.V. (or its group companies) does not guarantee that
the integrity of this communication has been maintained nor that this
communication is free of viruses, interceptions or interference.


---------------------------------------------------------------------------