Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (RealSerious3D, rvl), 1,187 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 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,731
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,731
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,987
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,987
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