Gamestudio Links
Zorro Links
Newest Posts
Removing outliers from files
by AndrewAMD. 12/02/26 15:26
SGT_FW
by Aku_Aku. 11/30/26 08:19
Experiences with cTrader
by JeyKey II. 11/27/26 09:04
make a complaint
by EW_bytes. 11/26/26 23:00
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (Quad), 6,074 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 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,150
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,150
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,150
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,150
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