Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Trade Management - Help Please #475056
11/20/18 21:06
11/20/18 21:06
Joined: Nov 2018
Posts: 4
C
ChrisCZZZ Offline OP
Guest
ChrisCZZZ  Offline OP
Guest
C

Joined: Nov 2018
Posts: 4
Hi everyone,

I am a newbie on Zorro..

Have been playing around for a while - I wrote a script and am currently doing a live trading test.

My trade logic involves two indicators crossing over/under each other to generate trade signals and I realize that Zorro always places its first trade that doesn't really make sense. I believe it is becasue when Zorro starts running, it immediately places a trade according to which indicator is above/under the other.

Is there a way/function that can help me skip the first trade of the simulation?

Thanks a lot everyone.

Re: Trade Management - Help Please [Re: ChrisCZZZ] #475057
11/20/18 22:10
11/20/18 22:10
Joined: Feb 2017
Posts: 1,729
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,729
Chicago
That does not sound right. Can you post your script?

Re: Trade Management - Help Please [Re: AndrewAMD] #475058
11/20/18 22:39
11/20/18 22:39
Joined: Nov 2018
Posts: 4
C
ChrisCZZZ Offline OP
Guest
ChrisCZZZ  Offline OP
Guest
C

Joined: Nov 2018
Posts: 4
Hi AndrewAMD,

Thank you so much for your reply. Script is as simple as the following. The problem is, I would expect a trade to be entered once PSAR flips above price, or flips below. However, whenever I start the script, a trade is entered. So I assume the first bar Zorro reads is either above or below PSAR, so that's why Zorro does a trade?

function tradereversetrend()
{

TimeFrame = 1;

vars Price = series(priceClose());
vars parasar = series(SAR(0.02,0.02,0.2));


if (ATR(5)>0.75){
if(crossOver(Price,parasar))
enterLong();
if(crossUnder(Price,parasar))
enterShort();
}
}

Re: Trade Management - Help Please [Re: ChrisCZZZ] #475087
11/22/18 08:10
11/22/18 08:10
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The script looks ok. It trades only when SAR swaps direction, so the trade on live start was probably just coincidence.

You can generally solve such problems by printing the SAR in the log or plotting it on the chart - then you can see when and why it trades.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1