Gamestudio Links
Zorro Links
Newest Posts
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/10/26 12:46
phantom() not defined in indicators.c
by jcl. 08/07/26 11:45
Pause button for evaluation shell?
by jcl. 08/07/26 11:43
Accepting new programming clients
by AndrewAMD. 08/06/26 21:25
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (AndrewAMD, Quad, VizTra, Radar), 852 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ParkerBlair, JackWalker, clausoliver, riggi89, shuhari
19225 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: 55
ozgur Offline
Junior Member
ozgur  Offline
Junior Member

Joined: Dec 2019
Posts: 55
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: 55
ozgur Offline
Junior Member
ozgur  Offline
Junior Member

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


Moderated by  Petra 

Gamestudio download | 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