Gamestudio Links
Zorro Links
Newest Posts
AssetsSP50.csv
by oldflatop. 04/19/21 10:21
Experience with Dukascopy plugin
by Hajoha. 04/19/21 09:11
OANDA-US No Balance Showing
by nullantechamber. 04/18/21 10:24
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/17/21 15:55
Script Template
by DdlV. 04/17/21 15:07
Sierra Chart Plugin
by AndrewAMD. 04/16/21 13:21
AUM Magazine
Latest Screens
Hecknex World
Scheherazade's Journey
Paradox Vector
The Space Between
Who's Online Now
9 registered members (AndrewAMD, oldflatop, AdamWu, Dooley, 3run, Hajoha, Quad, 2 invisible), 400 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
nayan, taygeezy, dadbean, VizTra, simonkrebs
18629 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
enterLong() and enterShort() are exiting opposites trades #482660
03/14/21 20:11
03/14/21 20:11
Joined: Mar 2021
Posts: 10
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 10
Casablanca, Morocco
Hello i noticed that when enterLong() is used openned short trade get's exited automatically without waiting to reach stoploss or takeprofit and the same with enterShort(), is there a way to open trades without exiting all opposite direction trades ?
ps: posting on 'blame the manual' section be cause i can't find an answer in the tutorial

Last edited by anissyo; 03/14/21 20:25.
Re: enterLong() and enterShort() are exiting opposites trades [Re: anissyo] #482662
03/14/21 23:15
03/14/21 23:15
Joined: Mar 2021
Posts: 10
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 10
Casablanca, Morocco
after a few hours of research i managed to understund that i need to disable hedging, but when i use hedging = 2; in the run() function i get an error, should i add hedging = 2; in another place ? in same sort of file in the directory where zorro is installed ?

any help is very appreciated, thank's in advance

Re: enterLong() and enterShort() are exiting opposites trades [Re: anissyo] #482663
03/14/21 23:19
03/14/21 23:19
Joined: Mar 2021
Posts: 10
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 10
Casablanca, Morocco
set (Hedge =2);

is the solution.

Re: enterLong() and enterShort() are exiting opposites trades [Re: anissyo] #482664
03/15/21 01:22
03/15/21 01:22
Joined: Feb 2017
Posts: 1,227
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,227
Chicago
Blame the Manual is for when you believe you have found errors in the manual.

You might get quicker responses in “Starting with Zorro”. It’s for people just starting to use Zorro.

Re: enterLong() and enterShort() are exiting opposites trades [Re: anissyo] #482670
03/15/21 20:37
03/15/21 20:37
Joined: Mar 2021
Posts: 10
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 10
Casablanca, Morocco
Okay thank you, i will try the other threads but just one question, when i use set(Hedge=2) the last short and long trade are not being exited as you can see in the picture i attached
can you plz help me point the problem ?? it's very weird... it's like the stop loss and target profit just stop's working suddently

Attached Files Zorro Chart - first_strategie_EURUSD.jpg
Re: enterLong() and enterShort() are exiting opposites trades [Re: anissyo] #482672
03/15/21 21:09
03/15/21 21:09
Joined: Feb 2017
Posts: 1,227
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,227
Chicago
Post your script in its entirety.

Re: enterLong() and enterShort() are exiting opposites trades [Re: anissyo] #482677
03/16/21 17:55
03/16/21 17:55
Joined: Mar 2021
Posts: 10
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 10
Casablanca, Morocco
Thank you so much, it's be cause the stoploss and takeprofit at thos two trades were 0, wich is the equivalent of no stop loss and no take profit so the trades were just kept open untill the backtest ended

Re: enterLong() and enterShort() are exiting opposites trades [Re: anissyo] #482683
03/16/21 22:20
03/16/21 22:20
Joined: Mar 2021
Posts: 10
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 10
Casablanca, Morocco
Hello Andrew again,
i just need you to point me to the right direction please, newbieness suck's lol...
i am 99% sure that my code is correct be cause under the same conditions i have enterLong(0); another variable is set to 1 each time the conditions are met to enter the market, i can see in the ploted graph of this variable that the value change's to 1 but the trade is not oppened in approximatively 30% of the times, i think it's be cause of the default trading time set by zorro trader but when i try to change the default trading time by adding " StartMarket = EndMarket = 0; " to disable market closing and trade 24h/24h the market i see unfortunately nothing change, thank you


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1