GTF is making continuously improvement on their deal book. I have been testing out their latest version:
version 2.21.73 Beta. I saw the following improvements:
- The programs loads a lot faster, operation is a lot smoother
- It is now possible to use "global" variables.
This is what i have been waiting for a long time. It is now possible to store a variable that isn't lost when the strategies run.
I will give an example :
*************************************************************
number SL; {=> here i store a global variable}
strategy test;
input lots = 1;
begin
series fast;
bool longallowed,shortallowed; {local variable are store here now }
integer currentbar;
currentbar := back(close);
if currentbar < 100 then return;
Fast_Stochastics();
fast:=Fast_Stochastics.line_d;
if fast[currentbar]<20 then
begin
buy(lots);
SL:= low[currentbar-1]; { here is put a stop loss level in the global variable}end;
if close[currentbar]<SL and long() then {here i check is close is under stop loss level}begin
if long() then exitlong();
end;
if fpl()<-5 then
begin
if long() then exitlong();
end;
end.
*************************************************************
Great job GTF :-)
hello,
ReplyDeleteis it possible to find an equation with 2 unkown variable ? For exemple:
I don't manage this equation: y = (5*x)+(1*x)
i try to find "x" .
"y" mustn't be more than 50.
How to find "x" to do "y" less than 50?
i tried a lot of loop but i didn''t the right one.
Can you help me?
I am not english so sorry for my bad speaking.
if Y=5*X + 1*X
ReplyDeletethan Y=6*X
and X=Y/6
take the 2 extremes
X=50/6=8,33
x=0/6=0
so the answer is
that x can between 0 and 8,33 for Y to be smaller than 50
I can find x . but i d'ont know how to write in CTL IDE...
ReplyDeleteIf you explain exactly what the code must do. I can try to write it for you..
ReplyDeleteit's ok for me. thanks a lot for your answer.
ReplyDeleteHi thanks for the blog. it's very helpful.
ReplyDeletei'm trying to figure out how to initialize a global variable. is it possible with the new global variable feature?
Yes it is. Example
ReplyDeletenumber profit:=0.0;
strategy example;
input lots=1;
begin
........