Script that waits for a specific price?

 

Hi all,

I'm new to programming and also new to forex trading... please bear with me! What I'm trying to do seems really simple and I would think there would be a script out there already for it but I can't find any. Basically, I just want to create a script to trigger a buy (or sell) when the price reaches a set value; this would be essentially the same as placing a limit order except that it would work regardless of whether the price was above or below the ask price. At first, I thought an EA would be the way to go but I only want to execute it once. Anyway, has anyone already done this? Or is it not possible for a script to continually watch the price? Thanks!

-nog

 

Have you read some codes? You can find heaps examples in MT platform.

 
nog:
Hi all,

I'm new to programming and also new to forex trading... please bear with me! What I'm trying to do seems really simple and I would think there would be a script out there already for it but I can't find any. Basically, I just want to create a script to trigger a buy (or sell) when the price reaches a set value; this would be essentially the same as placing a limit order except that it would work regardless of whether the price was above or below the ask price. At first, I thought an EA would be the way to go but I only want to execute it once. Anyway, has anyone already done this? Or is it not possible for a script to continually watch the price? Thanks!

-nog

That's what an EA does during every tick.

extern double setprice=1.2034

int start(){

if(Ask>=setprice)openorder();

}

void openorder(){.......
Reason: