Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, monk12, Quad), 829 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Position stopped even without stop loss / exit rule [Re: AndrewAMD] #477533
07/04/19 15:49
07/04/19 15:49
Joined: Apr 2019
Posts: 48
Albay
M
marr Offline OP
Newbie
marr  Offline OP
Newbie
M

Joined: Apr 2019
Posts: 48
Albay
I updated the code to your suggestion and get the same behavior, the duration of the trades is 0, no stop loss define and risk no exit rule too, same thing will happen even if I set a wide stop loss. which causes to lose always, it is weird why it happens. im using the latest zorro version

Re: Position stopped even without stop loss / exit rule [Re: marr] #477535
07/04/19 16:53
07/04/19 16:53
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Post the log of the first trade.

Re: Position stopped even without stop loss / exit rule [Re: Spirit] #477541
07/05/19 06:18
07/05/19 06:18
Joined: Apr 2019
Posts: 48
Albay
M
marr Offline OP
Newbie
marr  Offline OP
Newbie
M

Joined: Apr 2019
Posts: 48
Albay
Here is the log of the whole trade, note that I put a Stop = EMA13[0] - 2000 * PIP. I don't have any problem on trades that are exited by stop but the trades that are exited by sell. If you observe that the duration of the trades on the ExitType with Sold goes to 0. Also, I did not put any exitLong() and Risk.

Code
"Name","Type","Asset","ID","Lots","Open","Close","Entry","Exit","Profit","Roll","ExitType","Duration"
"EMA3","Long","TSLA",4303501,1,2019-03-12 17:55:00,2019-03-12 18:18:00,283.25,284.64,1384,0,"Stop",1380
"EMA3","Long","TSLA",4307401,1,2019-03-12 18:34:00,2019-03-12 18:41:00,284.13,283.42,-713,0,"Stop",420
"EMA3","Long","TSLA",4313901,1,2019-03-12 19:39:00,2019-03-12 19:39:00,282.94,282.63,-307,0,"Stop",0
"EMA3","Long","TSLA",4314501,1,2019-03-12 19:45:00,2019-03-12 19:51:00,283.09,282.84,-247,0,"Stop",360
"EMA3","Long","TSLA",4315201,1,2019-03-12 19:52:00,2019-03-12 20:12:00,283.07,282.8,-272,0,"Stop",1200
"EMA3","Long","TSLA",4317901,1,2019-03-12 20:19:00,2019-03-12 20:50:00,283.14,282.75,-393,0,"Stop",1860
"EMA3","Long","TSLA",4321301,1,2019-03-12 20:53:00,2019-03-12 20:56:00,283.21,282.81,-395,0,"Stop",180
"EMA3","Long","TSLA",4321701,1,2019-03-12 20:57:00,2019-03-12 21:01:00,283.26,282.83,-426,0,"Stop",240
"EMA3","Long","TSLA",4324301,1,2019-03-12 21:23:00,2019-03-12 21:42:00,283.2,282.73,-473,0,"Stop",1140
"EMA3","Long","TSLA",4326801,1,2019-03-12 21:48:00,2019-03-12 22:09:00,283.11,282.71,-402,0,"Stop",1260
"EMA3","Long","TSLA",4330201,1,2019-03-12 22:22:00,2019-03-12 22:24:00,283,282.74,-258,0,"Stop",120
"EMA3","Long","TSLA",4330501,1,2019-03-12 22:25:00,2019-03-12 23:12:00,282.91,282.57,-339,0,"Stop",2820
"EMA3","Long","TSLA",4335501,1,2019-03-12 23:15:00,2019-03-12 23:20:00,282.89,282.47,-420,0,"Stop",300
"EMA3","Long","TSLA",4336701,1,2019-03-12 23:27:00,2019-03-12 23:32:00,282.69,282.44,-246,0,"Stop",300
"EMA3","Long","TSLA",4337801,1,2019-03-12 23:38:00,2019-03-12 23:42:00,282.84,282.49,-352,0,"Stop",240
"EMA3","Long","TSLA",4338301,1,2019-03-12 23:43:00,2019-03-12 23:43:00,282.68,282.33,-349,0,"Stop",0
"EMA3","Long","TSLA",4338401,1,2019-03-12 23:44:00,2019-03-12 23:45:00,282.75,282.32,-434,0,"Stop",60
"EMA3","Long","TSLA",4338601,1,2019-03-12 23:46:00,2019-03-12 23:49:00,282.87,282.37,-498,0,"Stop",180
"EMA3","Long","TSLA",4339601,1,2019-03-12 23:56:00,2019-03-12 23:57:00,282.74,282.51,-237,0,"Stop",60
"EMA3","Long","TSLA",4339901,1,2019-03-12 23:59:00,2019-03-13 08:04:00,282.86,283.13,272,0,"Stop",29100
"EMA3","Long","TSLA",4350101,1,2019-03-13 09:41:00,2019-03-13 09:50:00,281.75,281.35,-400,0,"Stop",540
"EMA3","Long","TSLA",4357801,1,2019-03-13 10:58:00,2019-03-13 11:31:00,282,283.32,1323,0,"Stop",1980
"EMA3","Long","TSLA",4361201,1,2019-03-13 11:32:00,2019-03-13 11:40:00,283.89,283.51,-376,0,"Stop",480
"EMA3","Long","TSLA",4362301,1,2019-03-13 11:43:00,2019-03-13 11:45:00,284,283.17,-826,0,"Stop",120
"EMA3","Long","TSLA",4362601,1,2019-03-13 11:46:00,2019-03-13 11:46:00,283.68,283.51,-165,0,"Stop",0
"EMA3","Long","TSLA",4363201,1,2019-03-13 11:52:00,2019-03-13 12:23:00,283.99,283.47,-516,0,"Stop",1860
"EMA3","Long","TSLA",4366501,1,2019-03-13 12:25:00,2019-03-13 12:36:00,283.86,283.47,-390,0,"Stop",660
"EMA3","Long","TSLA",4367701,1,2019-03-13 12:37:00,2019-03-13 12:38:00,283.87,282.83,-1038,0,"Sold",60
"EMA3","Long","TSLA",4370801,1,2019-03-13 13:08:00,2019-03-13 13:08:00,282.96,282.73,-232,0,"Sold",0
"EMA3","Long","TSLA",4370901,1,2019-03-13 13:09:00,2019-03-13 13:09:00,283.03,282.8,-232,0,"Sold",0
"EMA3","Long","TSLA",4371001,1,2019-03-13 13:10:00,2019-03-13 13:10:00,283.05,283.02,-32.15,0,"Sold",0
"EMA3","Long","TSLA",4371101,1,2019-03-13 13:11:00,2019-03-13 13:11:00,283.22,282.85,-368,0,"Sold",0
"EMA3","Long","TSLA",4371201,1,2019-03-13 13:12:00,2019-03-13 13:12:00,283.31,283.11,-200,0,"Sold",0
"EMA3","Long","TSLA",4371301,1,2019-03-13 13:13:00,2019-03-13 13:13:00,283.31,283.11,-200,0,"Sold",0
"EMA3","Long","TSLA",4371401,1,2019-03-13 13:14:00,2019-03-13 13:14:00,283.31,282.99,-324,0,"Sold",0
"EMA3","Long","TSLA",4371501,1,2019-03-13 13:15:00,2019-03-13 13:15:00,283.45,283.29,-155,0,"Sold",0
"EMA3","Long","TSLA",4371601,1,2019-03-13 13:16:00,2019-03-13 13:16:00,283.7,283.32,-381,0,"Sold",0
"EMA3","Long","TSLA",4371701,1,2019-03-13 13:17:00,2019-03-13 13:17:00,283.8,283.6,-200,0,"Sold",0
"EMA3","Long","TSLA",4371801,1,2019-03-13 13:18:00,2019-03-13 13:18:00,283.8,283.59,-206,0,"Sold",0

Re: Position stopped even without stop loss / exit rule [Re: marr] #477544
07/05/19 10:12
07/05/19 10:12
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
A log is a file with type log in the folder Log.

Re: Position stopped even without stop loss / exit rule [Re: Spirit] #477545
07/05/19 11:49
07/05/19 11:49
Joined: Apr 2019
Posts: 48
Albay
M
marr Offline OP
Newbie
marr  Offline OP
Newbie
M

Joined: Apr 2019
Posts: 48
Albay
you meant this?

Attached Files
EMA3_test.txt (64 downloads)
Re: Position stopped even without stop loss / exit rule [Re: marr] #477548
07/05/19 13:40
07/05/19 13:40
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
No, thats a txt file. I mean the log file. Which you produce with LOGFILE flag and in which you look when you dont understand what your script is doing.

If all this is unfamilar to you then it might be better when you take the tutorial first or read a Zorro book or take a Zorro course. Trading software is not totally easy.

Re: Position stopped even without stop loss / exit rule [Re: marr] #477550
07/05/19 13:56
07/05/19 13:56
Joined: Apr 2019
Posts: 48
Albay
M
marr Offline OP
Newbie
marr  Offline OP
Newbie
M

Joined: Apr 2019
Posts: 48
Albay
I cant upload a logfile in this forum, it rejects the file i converted it to a .txt, that EMA3_test.txt is copy pasted from the LOGFILE produced when the flag is set

Re: Position stopped even without stop loss / exit rule [Re: marr] #477551
07/05/19 14:51
07/05/19 14:51
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Put it in a zip file.

Re: Position stopped even without stop loss / exit rule [Re: AndrewAMD] #477553
07/05/19 15:19
07/05/19 15:19
Joined: Apr 2019
Posts: 48
Albay
M
marr Offline OP
Newbie
marr  Offline OP
Newbie
M

Joined: Apr 2019
Posts: 48
Albay
Here is the log from the LOGFILE

Attached Files
EMA3_test.rar (13 downloads)
Re: Position stopped even without stop loss / exit rule [Re: marr] #477555
07/05/19 18:55
07/05/19 18:55
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Ok, now look in that log for the trade that you did not understand, you see there clearly what happened and why it was closed. It seems you have still not fixed your script as suggested. Its still the same problem. BTW, the error messages at the begin mean that the historical data is also missing.

Page 2 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1