1 registered members (AndrewAMD),
1,203
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
How works Zorro ? Im going crazy...
#478801
12/21/19 08:15
12/21/19 08:15
|
Joined: Apr 2018
Posts: 37
sdelatorre
OP
Newbie
|
OP
Newbie
Joined: Apr 2018
Posts: 37
|
Hello,
I have download 1 minute from script Download . Asset ("NZD/CHF") from OANDA
My code does :
BarPerdiod=60;
if (lhour(tUTC)==22 && minute(timezone)==0){ enterShort(profit); }
and when I change the BarPeriod 15 or 1 …. is different totally…...why ?
My function profit:
int profit if(TradeIsOpen and (TradeProfit/TradeUnits/PIP < -10))){exitTrade(); } if(TradeIsOpen and (TradeProfit/TradeUnits/PIP >10)){exitTrade(); }
return 0; }
Thanks in advance
Last edited by sdelatorre; 12/21/19 08:16.
|
|
|
Re: How works Zorro ? Im going crazy...
[Re: jcl]
#478818
12/25/19 17:44
12/25/19 17:44
|
Joined: Apr 2018
Posts: 37
sdelatorre
OP
Newbie
|
OP
Newbie
Joined: Apr 2018
Posts: 37
|
Thanks jcl,
By comparing two trades….but before that , my complete code
int profit(){ if(TradeIsOpen and (TradeProfit/TradeUnits/PIP < -10)&& TradeIsShort){exitTrade();} if(TradeIsOpen and (TradeProfit/TradeUnits/PIP >10)&& TradeIsShort){exitTrade();} return 0; }
function run() { set(PARAMETERS+TICKS+LOGFILE); StartDate = 20191215; EndDate = 20191220; BarPeriod = 60; //BarPeriod=1; asset("NZD/CHF"); if (lhour(WET)==22 && minute(WET)==0){enterShort(profit);} if (lhour(WET)==06 && minute(WET)==0){exitTrade();} }
I can oberve that the prices entershort and exit are different if I use different barPeriod, but Ithought that it will be the same because :
"In the backtest, the result of entering a trade can be either a pending trade, an opened trade, or a skipped trade. If no Entry limit is given, trades are opened at the current price or at the next open price, dependent on Fill mode. If a trade is pending, Zorro continues to attempt opening the trade within the time period given by EntryTime."
"A trade management function (TMF) is automatically called every tick - i.e. whenever the price changes - with the the optional variables (v0 .. v7) as arguments. It can evaluate the current price and other trade variables for closing the position or adjusting stop and profit limits"
Every tick is called function TMF and the trades open at the current Price...isn't it ? So why the difference ?
Another question..with my code only I want to know if the 22:00 is a good hour for openShort and get 10 PIPS, how could I do that ? Can you explain me that my code is doing ?
Maybe I don't understand all but Im going crazy.
Thanks a lot and I wait your answer.
Last edited by sdelatorre; 12/25/19 17:55.
|
|
|
Re: How works Zorro ? Im going crazy...
[Re: sdelatorre]
#478829
12/27/19 23:12
12/27/19 23:12
|
Joined: Dec 2019
Posts: 53
ozgur
Junior Member
|
Junior Member
Joined: Dec 2019
Posts: 53
|
Hi sdelatorre, I am a newbie as well so take everything with a pinch of salt. I am able to replicate similar backtest results with both 60 and 5 minute BarPeriod using the modified code below. Have a look and compare against your original code and deep dive into manual. I guess you also need to handle LOOKBACK to ensure backtest start at the same time. Not sure why 1 minute is producing different results though.
int profit()
{
if(TradeIsOpen && (TradeProfit/TradeUnits/PIP < -10) && TradeIsShort)
{
exitTrade();
}
if(TradeIsOpen && (TradeProfit/TradeUnits/PIP > 10) && TradeIsShort)
{
exitTrade();
}
return 0;
}
function run()
{
set(LOGFILE,PLOTNOW,TICKS);
Fill = 0; // For the sake of comparison, not realistic otherwise
StartDate = 20191215;
EndDate = 20191220;
BarMode = BR_FLAT; // To handle potential missing M1 data which would screw up time comparisons below...
//BarPeriod=60;
BarPeriod=5;
asset("EUR/USD");
if(hour()==22 && minute()==0)
{
enterShort(profit);
}
if(hour()==06 && minute()==0)
{
exitTrade();
}
}
Last edited by ozgur; 12/27/19 23:39.
|
|
|
Re: How works Zorro ? Im going crazy...
[Re: sdelatorre]
#478869
01/02/20 21:40
01/02/20 21:40
|
Joined: Apr 2018
Posts: 37
sdelatorre
OP
Newbie
|
OP
Newbie
Joined: Apr 2018
Posts: 37
|
Hello again,
with Fill=0 the results are similar but Why I have to use Fill=0 if is for special purposes ??? . The tutorial says :
1 Realistic order filling (default). Trades open or close at the current price quote plus extra Slippage. When Slippage is set to 0, this mode simulates a latency-free connection to the market that immediately reacts on any price quote
I have tested and Really with Fill=1 and barPeriod different is very different the results…....maybe have I use Fill=0 for my backtests ? This is the part that I can't understand…..Realistic =Fill 1 ...but different results with barPerdiod and Fill=0 special purposes but results similar.
Another question is if I use a TMF the exit trade must be the same if the Price open is the same independtly of the barPerdiod,..this is ok, true ??
Thanks in advance
Last edited by sdelatorre; 01/02/20 21:43.
|
|
|
|