Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, AndrewAMD, TedMar), 837 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Long and Short opens at same time #418470
02/24/13 23:40
02/24/13 23:40
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
I want to turn it to a robot.

Open a Buy and Sell order at the same time with same TP x pips and same SL x pips( I also use a indicator stop loss like MA).

Once one of the two open orders hit TP or SL, Immediately the other opened order's TP is modified. SL is still remain same or can be changed. Daynamic SL like ATR doesn't need change every bar.

I want to do it on every new bar, when my condition met.
Is it possible?

Also please explain how different lots are used.
For example, when a condition is met, more lots are used than the other trade lots. I want to do it on every new candle, when I open both trades at the same time.

Thanks in advance.

Last edited by SFF; 02/25/13 00:11.
Re: Long and Short opens at same time [Re: SFF] #418484
02/25/13 11:30
02/25/13 11:30
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Set HEDGING for opening opposite positions at the same time.

When you want to change the TP of the other order immediately when an order exits, you need a trade function that checks if the other function is still open, and modifies the TP otherwise. Look for an example under "Trade Parameters".

For setting the trade size, read workshop 6 and the "Lots" page in the manual.

Re: Long and Short opens at same time [Re: jcl] #418596
02/27/13 01:48
02/27/13 01:48
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
Thanks.

When I don't set HEDGING, a reverse order means exit?

For example is below. It doesn't have a exit order.

Code:
function run()
{
  vars Price = series(price());
  vars Trend = series(LowPass(Price,1000));

  Stop = 4*ATR(100);
  if(valley(Trend))
    enterLong();
  else if(peak(Trend))
    enterShort();
}


Re: Long and Short opens at same time [Re: SFF] #418602
02/27/13 09:25
02/27/13 09:25
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, without HEDGING a short order automatically exits an open long position and vice versa.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1