Forex



Go Back   Forex Trading > Programming > Metatrader Programming






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 09-23-2008, 01:52 AM
Senior Member
 
Join Date: Aug 2008
Location: London
Posts: 138
Limstylz is on a distinguished road
So I wrote this little script...

Hi Ladies and Gents,

Could someone take a look at my script and help me clean it up a little bit please?

Its based on a breakout strategy and places a stradle order if the market price hasn't hit and is not within the market spread yet, using 2 pending trades (buystop and sellstop).

If the market price has hit; if its an order going short, the script places an immediate sell order and exits without placing a pending order going long. if its a long trade, the script places the long trade and deletes the pending short trade.

The above orders work. However, how do i get the script to detect if the current market price is too close to the ask or bid price to place pending trades and execute an immediate trade instead? I can't figure this out at all!

This is one of 3 final items that I need to learn before I turn this into an EA, so any help will be of assistance. The other 2 being money management and how to place the trades at specific times (I think I saw this as a thread here actually).

I look forward to your constructive critisisms and advice.
Attached Files
File Type: mq4 Blaze.mq4 (1.4 KB, 14 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a Script from an EA witchazel Metatrader 4 7 09-21-2008 10:25 PM
T/p S/L ....script hitman Metatrader 4 5 12-14-2006 10:37 PM
Script halfasleep General Discussion 4 12-01-2006 03:44 PM
How can an EA Execute Script in the.... babarmughal Expert Advisors - Metatrader 4 2 05-16-2006 11:15 PM


All times are GMT. The time now is 12:42 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.