As far as I know, a new tick is triggering the signal to calculate.
What if the signal calculating is not done yet, and a new tick is coming in (fast markets). Will the signal start all over again and not finish the earlier triggered calculating?
So the question is: will the calculating of a signal be interrupted by a new incoming tick or does it finish all the code untill the end, before it will calculate again when a new tick is coming in.
I ask this because, when using "If (barstatus(1) = 2) and time = 900 then begin", sometimes does not trigger a trade in fast markets. So it looks like not all code to the end of the script is processed before a new tick is coming in.
How is a script (signal) calculated [SOLVED]
- Angelina MultiСharts
- Posts: 260
- Joined: 28 Dec 2016
- Has thanked: 28 times
- Been thanked: 66 times
Re: How is a script (signal) calculated
Hello evdl,
The signal finishes the calculation for one tick before starting recalculation for a new one.
Do you print your strategy order generation?
The signal finishes the calculation for one tick before starting recalculation for a new one.
Do you print your strategy order generation?
-
- Posts: 401
- Joined: 19 Jan 2011
- Location: Netherlands
- Has thanked: 85 times
- Been thanked: 124 times
Re: How is a script (signal) calculated [SOLVED]
Hi Angelina,
I use printstatements to debug. It is hard to debug because it must happen realtime. Now I can rule out the possibility that script is interrupted before reaching the end of the script.
Thanks.
I use printstatements to debug. It is hard to debug because it must happen realtime. Now I can rule out the possibility that script is interrupted before reaching the end of the script.
Thanks.
- Smoky
- Posts: 507
- Joined: 03 Dec 2010
- Location: Thailand
- Has thanked: 97 times
- Been thanked: 115 times
Re: How is a script (signal) calculated
Code: Select all
Vars: intrabarpersist Enrg("") , intrabarpersist FileLog("TRD.csv"), intrabarpersist order(""), intrabarpersist dat(""), intrabarpersist heur("");
//first line of file
once begin
Enrg ="FLUX;DAT;HEUR;ORD;OPEN;HIGH;LOW;CLOSE";
print(file(Filelog),Enrg);
end;
//on every ticks
dat = DateBar();
heur = FormatTime("HH:mm:ss:ms",datetime);
Enrg = "BID;" + dat + ";" + heur +";" +order +";"+ numtostr(open data1,0) +";"+ numtostr(high data1,0) +";"+ numtostr(low data1,0) +";"+ numtostr(close data1,0) ;
print(file(Filelog),Enrg);
Code: Select all
//function DateBar();
Variables: dateInDateTime(0);
dateInDateTime = ELDateToDateTime(Date);
DateBar = FormatDate("yyyyMMdd",dateInDateTime);
and you can read this file with Excel , or OpenOffice
don't worry EL is very speed, i run 1500 code lines in tick/tick without any problem LoL
hope this can help you to debug your script...