Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
pending orders #410708
11/07/12 13:26
11/07/12 13:26
Joined: Nov 2012
Posts: 19
Texas, US
D
deweymcg Offline OP
Newbie
deweymcg  Offline OP
Newbie
D

Joined: Nov 2012
Posts: 19
Texas, US
Please forgive the newbie question but I am new to coding. I am trying to write a script where when certain conditions are met a pending buy or sell order is placed when price hits the value of tema. The pseudocode would be:

If (condition) then

Buy (MoneyManagement computed) lots at TEMA( 74 )[1]; (and the reverse for a sell order).


I know you can call a function inside an enterLong() command, but I can't figure out how to do this.

Re: pending orders [Re: deweymcg] #410709
11/07/12 14:11
11/07/12 14:11
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
The function inside enterlong is for trade exit only, not (yet) for trade entry. For entering, just check if the price hits TEMA and then place a market order.

Re: pending orders [Re: jcl] #410731
11/07/12 18:54
11/07/12 18:54
Joined: Nov 2012
Posts: 19
Texas, US
D
deweymcg Offline OP
Newbie
deweymcg  Offline OP
Newbie
D

Joined: Nov 2012
Posts: 19
Texas, US
I wanted it to place a pending order for the value of TEMA at the time the first condition is met. TEMA would be at a different value if we wait until price converges with TEMA. is there a way to do that?

Re: pending orders [Re: deweymcg] #410775
11/08/12 16:50
11/08/12 16:50
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Sure, enter at market when the price crosses the TEMA _and_ the first condition was met within the last n bars.

Re: pending orders [Re: deweymcg] #410779
11/08/12 17:58
11/08/12 17:58
Joined: Sep 2012
Posts: 74
Niedersachsen, Germany
P
PriNova Offline
Junior Member
PriNova  Offline
Junior Member
P

Joined: Sep 2012
Posts: 74
Niedersachsen, Germany
Originally Posted By: deweymcg
I wanted it to place a pending order for the value of TEMA at the time the first condition is met. TEMA would be at a different value if we wait until price converges with TEMA. is there a way to do that?


if i understand you right, you would place a pending order at the actual price of TEMA, when conditions meet.
i suggest you store the price of TEMA in a variable at the given condition and check if price of market hit this value and open then a market order.
Then it doesn't matter if TEMA changes after x-bars, because you captured the price of TEMA at your defined conditions.

pseudocode:
Code:
if(condition1 == true)
{
   var TEMAvalue = TEMA(...);
}
if(priceClose() == TEMAvalue)
{
   enterTrade();
}


Last edited by PriNova; 11/08/12 18:01.
Re: pending orders [Re: PriNova] #410781
11/08/12 19:12
11/08/12 19:12
Joined: Nov 2012
Posts: 19
Texas, US
D
deweymcg Offline OP
Newbie
deweymcg  Offline OP
Newbie
D

Joined: Nov 2012
Posts: 19
Texas, US
Thanks! That looks like it will do the trick. I will test this when I get back home


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1