Regular visitors will have noticed ever increasing amounts of spam on the Trading Gurus Community Forum. On November 24th 2012 we implemented some changes:
1. New users will be moderated
2. Registered users who have a post count of zero will not be able to view attachments or download code.
3. Registered users who have a post count of zero will not be able to create a new thread
As an additional countermeasure we anticipate introducing a modest paywall in the near future.
If this is your first visit here our apologies for the inconvenience.
Existing users may wish to contribute their ideas to this thread.

Hi!
Currently i test the price_******l_trading in eur/usd 5 minutes chart. I'm thinking about, how to make it better in stop/limit handling. I think, i will add some indicator to it, and see how it goes, but i need a little more to understand of programming this.

I have discovered, that this robot workks best on EUR/USD and USD/JPY, and use 6 for periodisma and shift instead of 5!!!
Today it made a big money with theese settings.

Originally Posted by
Balu77
I have discovered, that this robot workks best on EUR/USD and USD/JPY, and use 6 for periodisma and shift instead of 5!!!
Today it made a big money with theese settings.
Thats great balu. But they are not holy grail systems. So use with care.....thanks for sharing your settings.

Administrator
Hi Balu,
Originally Posted by
Balu77
I have discovered, that this robot workks best on EUR/USD and USD/JPY, and use 6 for periodisma and shift instead of 5!!!
Today it made a big money with theese settings.
As CTL points out, one swallow is very nice, but it doesn't necessarily make a summer! Have you done any backtesting yet? How about optimization?
Cheers,
Jim
Reality is merely an illusion, albeit a very persistent one  Albert Einstein


I have an indicator called supertrend. I have just made a strategy on it. If it works, i will post it here.
That will be my first work alone!
As i see, this program language is like pascal, that i used for 15 years ago, its time to refresh my old sheets.
Two pc's speeking: Did you knew that we are compatible? 
Heeeeeeeeee??

Administrator
Hi Balu,
It is not just like Pascal, it IS Pascal!
Sounds like you should be right at home with it. Which Pascal compiler did you use, all those years ago?
Cheers,
Jim
Reality is merely an illusion, albeit a very persistent one  Albert Einstein

Borland Turbo pascal.
It was fun!
Hmm, that
if ... then .. return statement is not clear to me in this. As i remember return was used in procedures. So how does it works here in ifthat statement?
Last edited by Balu77; 02052011 at 06:25 PM.
Two pc's speeking: Did you knew that we are compatible? 
Heeeeeeeeee??

Administrator
Hi Balu,
It still is fun, although Turbo has moved on to become Object Pascal and Delphi, not to mention Free Pascal and Lazarus.
A CTL strategy essentially is just "a procedure". Looks like in this case it simply keeps on returning immediately until enough bars are available for the 200 EMA to make sense.
Cheers,
Jim
Reality is merely an illusion, albeit a very persistent one  Albert Einstein

I have an indicator called supertrend. I've made a strategy on it, but it wont work. The codes are ok, but it doesnt make what it should. Any idea why?
the strategy i wrote:
strategy supertrend_strategy;
/* SuperTrend strategy by Balu  balu@fw.hu */
input
CalcPriceType_ST = 1,
TrendPriceType_ST = 2,
VolatPeriod_ST = 1,
VolatCoeff_ST = 1.8,
AvgToVolatRatio_ST = 10,
UpDnCalcType_ST = 6,
lots =1,
periodsma = 5,
shift = 5;
begin
SuperTrend(CalcPriceType_ST,TrendPriceType_ST,Vola tPeriod_ST,AvgToVolatRatio_ST,UpDnCalcType_ST);
{entry conditions}
if not long() and not short() and crossdown(SuperTrend.Avgprice, SuperTrend.Stop) then sell(lots);
if not long() and not short() and crossdown(SuperTrend.Stop, SuperTrend.AvgPrice) then buy(lots);
{exit conditions}
if crossdown(SuperTrend.Stop, SuperTrend.AvgPrice) and short() then exitshort();
if crossup(SuperTrend.Stop, SuperTrend.AvgPrice) and long() then exitlong();
end.[/I]
the supertrend indicator code:
indicator SuperTrend;
input
CalcPriceType = 1, // type of price calculation over which average will be calculated
TrendPriceType = 2, // type of price calculation over which trend direction will be calculated
VolatPeriod = 1, // period to look for volatility
VolatCoeff = 1.8, // distance from average, multiply of volatility
AvgToVolatRatio = 10, // period to calculate average, multiply of volatility period
UpDnCalcType = 6; // type of calculation for stops
draw
AvgPrice("AvgPrice"),
Stop("Stop");
vars
i(number),
VolatUpCoeff(number),
VolatDnCoeff(number),
HH(series),
LL(series),
CalcPrice(series),
TrendPrice(series),
Volat(series),
AvgVolat(series),
AvgPeriod(number),
Up(series),
Dn(series),
Trend(series);
begin
VolatUpCoeff := abs(VolatCoeff);
VolatDnCoeff := abs(VolatCoeff);
AvgPeriod := AvgToVolatRatio*VolatPeriod;
HH := Highest(High, VolatPeriod);
LL := Lowest(Low, VolatPeriod);
if CalcPriceType = 1 then
CalcPrice := Close;
if CalcPriceType = 2 then
CalcPrice := (HH+LL)/2;
if CalcPriceType = 3 then
CalcPrice := (HH+LL+Close)/3;
if CalcPriceType = 4 then begin
CalcPrice := Close;
for i := front(Close)+VolatPeriod1 to back(Close) do
CalcPrice[i] := (HH[i]+LL[i]+Close[i]+Low[iVolatPeriod+1])/4;
end;
if CalcPriceType = 5 then begin
CalcPrice := Close;
for i := front(Close)+VolatPeriod to back(Close) do
CalcPrice[i] := (HH[i]+LL[i]+Close[iVolatPeriod])/3;
end;
if CalcPriceType = 6 then begin
CalcPrice := Close;
for i := front(Close)+VolatPeriod to back(Close) do
CalcPrice[i] := (HH[i]+LL[i]+Close[iVolatPeriod]+Low[iVolatPeriod+1])/4;
end;
if TrendPriceType = 1 then
TrendPrice := Close;
if TrendPriceType = 2 then
TrendPrice := (HH+LL)/2;
if TrendPriceType = 3 then
TrendPrice := (HH+LL+Close)/3;
if TrendPriceType = 4 then begin
TrendPrice := Close;
for i := front(Close)+VolatPeriod1 to back(Close) do
TrendPrice[i] := (HH[i]+LL[i]+Close[i]+Low[iVolatPeriod+1])/4;
end;
if TrendPriceType = 5 then begin
TrendPrice := Close;
for i := front(Close)+VolatPeriod to back(Close) do
TrendPrice[i] := (HH[i]+LL[i]+Close[iVolatPeriod])/3;
end;
if TrendPriceType = 6 then begin
TrendPrice := Close;
for i := front(Close)+VolatPeriod to back(Close) do
TrendPrice[i] := (HH[i]+LL[i]+Close[iVolatPeriod]+Low[iVolatPeriod+1])/4;
end;
Volat := (HH  LL)/2;
Up := CalcPrice;
Dn := CalcPrice;
if AvgToVolatRatio>1 then begin
if UpDnCalcType=1 or UpDnCalcType=2 then begin
AvgPrice := SMA(CalcPrice, AvgPeriod);
AvgVolat := SMA(Volat, AvgPeriod);
Up := AvgPrice+VolatUpCoeff*AvgVolat;
Dn := AvgPrice+VolatDnCoeff*AvgVolat;
end;
if UpDnCalcType=3 or UpDnCalcType=4 then begin
AvgPrice := EMA(CalcPrice, AvgPeriod);
AvgVolat := EMA(Volat, AvgPeriod);
Up := AvgPrice+VolatUpCoeff*AvgVolat;
Dn := AvgPrice+VolatDnCoeff*AvgVolat;
end;
if UpDnCalcType=5 or UpDnCalcType=6 then begin
AvgPrice := WMA(CalcPrice, AvgPeriod);
AvgVolat := WMA(Volat, AvgPeriod);
Up := AvgPrice+VolatUpCoeff*AvgVolat;
Dn := AvgPrice+VolatDnCoeff*AvgVolat;
end;
if UpDnCalcType=7 or UpDnCalcType=8 then begin
AvgPrice :=WMA(2*WMA(CalcPrice, int(AvgPeriod/2))  WMA(CalcPrice, AvgPeriod),
int(SQRT(AvgPeriod)));
AvgVolat :=WMA(2*WMA(Volat, int(AvgPeriod/2))  WMA(Volat, AvgPeriod),
int(SQRT(AvgPeriod)));
Up := AvgPrice+VolatUpCoeff*AvgVolat;
Dn := AvgPrice+VolatDnCoeff*AvgVolat;
end;
end else begin
AvgPrice := CalcPrice;
Up := CalcPrice+VolatUpCoeff*Volat;
Dn := CalcPrice+VolatDnCoeff*Volat;
end;
Trend := makeseries(front(Close), back(Close), 0);
for i := front(Close)+AvgPeriod+1 to back(Close) do begin
if (AvgToVolatRatio>1) and (UpDnCalcType=2 or UpDnCalcType=4 or UpDnCalcType=6 or
UpDnCalcType=8) then begin
if Trend[i1]<0 then begin
if Up[i]>Up[i1] then
Up[i] := Up[i1];
end;
if Trend[i1]>=0 then begin
if Dn[i]<Dn[i1] then
Dn[i] := Dn[i1];
end;
end;
Trend[i] := Trend[i1];
if TrendPrice[i]>Up[i] then
Trend[i] := 1;
if TrendPrice[i]<Dn[i] then
Trend[i] := 1;
end;
for i := front(Close)+AvgPeriod to back(Close) do begin
if Trend[i] >= 0 then
Stop[i] := Dn[i]
else
Stop[i] := Up[i];
end;
end.
Two pc's speeking: Did you knew that we are compatible? 
Heeeeeeeeee??
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules