• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 7:48am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 7:48am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Buy Stop Limit and Sell Stop Limit Orders on MT4 6 replies

Auto SL/TP & buy limit, sell limit/buy stop, sell stop EA/indi 2 replies

Difference between buy limit, sell limit, buy stop, & sell stop? 4 replies

Market Profile type indicator for closes instead of ticks 11 replies

Stop orders instead of limit orders 0 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: Triggering Limit/Stop orders on Candle closes instead of Ticks
Cancel

Triggering Limit/Stop orders on Candle closes instead of Ticks

  • Post #1
  • Quote
  • First Post: Dec 20, 2010 6:14am Dec 20, 2010 6:14am
  •  thokthok
  • | Joined Dec 2010 | Status: Member | 71 Posts
Currently I am using Meta Trader ... and as you may know that it handles limit/stop orders based on the Tick values ... A single tick above or below the configured stop/limit order may trigger it ...

But what I want is to trigger these Limit/Stop orders once candle of a given timeframe closed above that limit/stop level? How can this be achieved?
  • Post #2
  • Quote
  • Dec 20, 2010 1:49pm Dec 20, 2010 1:49pm
  •  CodeMeister
  • Joined Sep 2009 | Status: Making Code While Making Pips | 1,672 Posts
I think I understand the question, but I'm not sure of the context. I will assume that you are using an EA to manage the trade.

Instead of doing tick by tick trade management, you should do it bar by bar. Instead of sending the stop/limit orders to the server, you should submit a market order if the right conditions are met on the opening of the new bar.

Here is a code snippet to get you started. Declare barStart as a static datetime variable.

PHP Code
  if (barStart < Time[0])
   {
// put logic here to trigger market order
      
barStart = Time[0];
   } 
// end if 
 
 
  • Post #3
  • Quote
  • Dec 20, 2010 11:56pm Dec 20, 2010 11:56pm
  •  thokthok
  • | Joined Dec 2010 | Status: Member | 71 Posts
thank you .. you have understood the question perfectly.

when dealing with smaller time frames i think, this method can save us from stop order getting triggered on price spikes... and if we are using right amount of leverage, we would not be loosing much in long term even if price went a little opposite to our stop/limit levels.


Quoting CodeMeister
Disliked
I think I understand the question, but I'm not sure of the context. I will assume that you are using an EA to manage the trade.

Instead of doing tick by tick trade management, you should do it bar by bar. Instead of sending the stop/limit orders to the server, you should submit a market order if the right conditions are met on the opening of the new bar.

Here is a code snippet to get you started. Declare barStart as a static datetime variable.

[php] if (barStart < Time[0])...
Ignored
 
 
  • Post #4
  • Quote
  • Last Post: Dec 21, 2010 12:15am Dec 21, 2010 12:15am
  •  CodeMeister
  • Joined Sep 2009 | Status: Making Code While Making Pips | 1,672 Posts
I don't understand what you are trying to do, but I took a guess. That is always harder than writing the code. Glad you found my answer useful.
 
 
  • Platform Tech
  • /
  • Triggering Limit/Stop orders on Candle closes instead of Ticks
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023