Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 468 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Trade Question #480371
06/03/20 05:13
06/03/20 05:13
Joined: May 2020
Posts: 3
Glendale
T
trader310 Offline OP
Guest
trader310  Offline OP
Guest
T

Joined: May 2020
Posts: 3
Glendale
HI all,

I'm a newbie to Zorro, am I'm backtesting trade signals produced by an AI model.

My question is why is this plotted as a losing trade? The logs show a winning trade, but the chart shows a red line, and a loss. (see the attached image):

Here's the log for what should be a winning trade:

Code

BUY 1
[EURUSD_2020_CNN::L05401] Long 1000000@1.11824  at 12:00:00
Com 0000  Mrg 25000000  Net 0
Units 1.0000  MTotal 0.00  MCost 25.0000 PCost 0.01000 Opn 54

[55: Thu 20-01-02 12:15] 0000 -9490 0/1  1.11902/1.11920\1.11824/1.11875 -0.01000
[56: Thu 20-01-02 12:30] 0000 -9190 0/1  1.11912/1.11938\1.11875/1.11905 -0.01000
[57: Thu 20-01-02 12:45] 0000 -9300 0/1  1.11914/1.11938\1.11894/1.11894 -0.01000
[58: Thu 20-01-02 13:00] 0000 -9180 0/1  1.11925/1.11936\1.11894/1.11906 -0.01000
[59: Thu 20-01-02 13:15] 0000 -9130 0/1  1.11919/1.11965\1.11906/1.11911 -0.01000
SELL 2
[EURUSD_2020_CNN::L05401] exit
[EURUSD_2020_CNN::L05401] Sell 1000000@1.11911: -9130 Bid 1.10911 at 13:15:00
Opn 1.11824 Cls 1.11911 Spr 0.01000000 Slp 0.00 Rol 0.00 Com 0.00 Net 1000000
Max Loss 0.00 -> 9130.01
Max Bars 0 -> 59-54



The code for trading is the signals is:

Code

 int signal = (int)marketVal();
 if (signal == 1 && (!TradeIsOpen)) {
	// signal
	 printf("\nBUY %d", signal);
	
    enterLong(1000000);
	
 }
 else if (signal == 2) {
	 printf("\nSELL %d", signal);
    exitLong();

 }



Appreciate any guidance... what am I missing here?


Attached Files
trade-question.PNG (9 downloads)
Last edited by trader310; 06/03/20 05:15.
Re: Trade Question [Re: trader310] #480384
06/03/20 14:31
06/03/20 14:31
Joined: Dec 2019
Posts: 53
ozgur Offline
Junior Member
ozgur  Offline
Junior Member

Joined: Dec 2019
Posts: 53
Spread is 100 pips?

Re: Trade Question [Re: trader310] #480386
06/03/20 16:01
06/03/20 16:01
Joined: May 2020
Posts: 3
Glendale
T
trader310 Offline OP
Guest
trader310  Offline OP
Guest
T

Joined: May 2020
Posts: 3
Glendale
Yes! I was able to set a 2 pip spread (on forex) using the following:

Code
Spread = 0.002*PIP;


Thank you!

Last edited by trader310; 06/03/20 16:01.
Re: Trade Question [Re: trader310] #480388
06/03/20 17:11
06/03/20 17:11
Joined: Dec 2019
Posts: 53
ozgur Offline
Junior Member
ozgur  Offline
Junior Member

Joined: Dec 2019
Posts: 53
I think you should write "2*PIP" for 2 pips spread.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1