Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Imhotep, opm), 785 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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: 42
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 42
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: 42
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 42
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: 42
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 42
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,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
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: 42
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 42
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,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
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: 42
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 42
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: 42
Casablanca, Morocco
anissyo Offline OP
Newbie
anissyo  Offline OP
Newbie

Joined: Mar 2021
Posts: 42
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