Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 13,353 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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,806
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,806
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: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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