Trade Management - Help Please

Posted By: ChrisCZZZ

Trade Management - Help Please - 11/20/18 21:06

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.
Posted By: AndrewAMD

Re: Trade Management - Help Please - 11/20/18 22:10

That does not sound right. Can you post your script?
Posted By: ChrisCZZZ

Re: Trade Management - Help Please - 11/20/18 22:39

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();
}
}
Posted By: jcl

Re: Trade Management - Help Please - 11/22/18 08:10

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.
© 2024 lite-C Forums