Gamestudio Links
Zorro Links
Newest Posts
A9
by 3run. 07/08/20 18:44
Historical ticks for Lookback backfill
by Zheka. 07/08/20 09:10
Trade Mode without a broker
by jj02520024. 07/08/20 01:20
How to handle algo name in Simulate.c
by happysun. 07/07/20 08:56
Erasing a datapoint in a plot array
by jcl. 07/06/20 09:51
typo
by jcl. 07/06/20 09:44
Video Panel System
by Emre. 07/06/20 09:39
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
7 registered members (3run, Quad, FLD, deus777, Ayumi, jenGs, kvm), 425 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
TraderKevin, deus777, carolthesecond, Roger399, vrindger
18474 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 (6 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: 20
ozgur Offline
Newbie
ozgur  Offline
Newbie

Joined: Dec 2019
Posts: 20
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: 20
ozgur Offline
Newbie
ozgur  Offline
Newbie

Joined: Dec 2019
Posts: 20
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