Using Limit entry, how to know if entry was execute - Multicharts - EasyLanguage Programming | futures io social day trading
futures io futures trading


Using Limit entry, how to know if entry was execute - Multicharts
Updated: Views / Replies:4,988 / 11
Created: by arjfca Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Using Limit entry, how to know if entry was execute - Multicharts

  #1 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: Interactive Broker
Favorite Futures: Forex
 
Posts: 262 since Sep 2010
Thanks: 436 given, 86 received

Using Limit entry, how to know if entry was execute - Multicharts

Hello again to all

With Multicharts and IB as a broker,

I'm using a limit entry order like

 
Code
 
[ SellShort ("Short1b") ShortSizeOfOrder contracts next bar at ShortEntryPrice Limit;
MC will cancel the order if the limit price was not reach before the end of the bar. I need to set a flag at the begining of the next bar to confirm that the order as been execute. How can i do it?


Martin

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,231 received



arjfca View Post
Hello again to all

With Multicharts and IB as a broker,

I'm using a limit entry order like

 
Code
 
[ SellShort ("Short1b") ShortSizeOfOrder contracts next bar at ShortEntryPrice Limit;
MC will cancel the order if the limit price was not reach before the end of the bar. I need to set a flag at the begining of the next bar to confirm that the order as been execute. How can i do it?


Martin

The simplest way would be to look at MarketPosition and see if it is right (0 flat, 1 long, -1 short). There is also EntryPrice(0) to see the last execution entry price, it may be helpful to you.

But if you are scaling in or out then this may not be sufficient for you. So you could look at BarsSinceEntry as well as CurrentContracts, and figure out where you stand.

All of this is in the help under 'Strategy Positions'.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:
 
  #4 (permalink)
 Vendor: www.systemtradersuccess.com 
Gurnee, IL
 
Futures Experience: Advanced
Platform: TradeStation
Broker/Data: TradeStation
Favorite Futures: Futures
 
Posts: 46 since Apr 2010
Thanks: 17 given, 92 received


arjfca View Post
Hello again to all

With Multicharts and IB as a broker,

I'm using a limit entry order like

 
Code
 
[ SellShort ("Short1b") ShortSizeOfOrder contracts next bar at ShortEntryPrice Limit;
MC will cancel the order if the limit price was not reach before the end of the bar. I need to set a flag at the begining of the next bar to confirm that the order as been execute. How can i do it?


Martin

This might help. The following code will tell you if a new position was entered.

 
Code
Variables:
MP(0);


MP = MarketPosition;

If ( MP <> 0 ) And ( MP[1] = 0 ) Then
Begin
    // A new position was just entered 
End;

Reply With Quote
The following user says Thank You to Jeff65 for this post:
 
  #5 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: Interactive Broker
Favorite Futures: Forex
 
Posts: 262 since Sep 2010
Thanks: 436 given, 86 received

Thanks

My programmed strategy look to enter on all valid signals, even in the same direction. Each trade is manage independently. Up to ten trades per direction. So marketposition is not reliable if trade as occured or not.

I will look for arround Big Mike solution with BarsSinceEntry as well as CurrentContracts.

This verification to be done for bar status = 1 (beginning of a bar) for the first bar following the entry bar.

Martin

Reply With Quote
 
  #6 (permalink)
 Vendor: www.systemtradersuccess.com 
Gurnee, IL
 
Futures Experience: Advanced
Platform: TradeStation
Broker/Data: TradeStation
Favorite Futures: Futures
 
Posts: 46 since Apr 2010
Thanks: 17 given, 92 received


arjfca View Post
Thanks

My programmed strategy look to enter on all valid signals, even in the same direction. Each trade is manage independently. Up to ten trades per direction. So marketposition is not reliable if trade as occured or not.

I will look for arround Big Mike solution with BarsSinceEntry as well as CurrentContracts.

This verification to be done for bar status = 1 (beginning of a bar) for the first bar following the entry bar.

Martin

This might help.

With multiple trades you can manage them independently by using the function "CurrentEntries". Create a variable to hold this value and manage each trade by how many current entries there are.

 
Code
CE = CurrentEntries;

      If ( MP = 1 ) Then
      Begin
              If (  CE  = 1 ) Then {manage one entry}
              If (  CE  = 2 ) Then {Manage two entries }
              If (  CE  = 3 ) Then {Manage three entries }
      End
      Else If ( MP = -1 ) Then
      Begin
              If (  CE  = 1 ) Then {manage one entry}
              If (  CE  = 2 ) Then {Manage two entries }
              If (  CE  = 3 ) Then {Manage three entries }
      End

Reply With Quote
The following 2 users say Thank You to Jeff65 for this post:
 
  #7 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: Interactive Broker
Favorite Futures: Forex
 
Posts: 262 since Sep 2010
Thanks: 436 given, 86 received


Jeff65 View Post
This might help.

With multiple trades you can manage them independently by using the function "CurrentEntries". Create a variable to hold this value and manage each trade by how many current entries there are.

 
Code
 
CE = CurrentEntries;
 
      If ( MP = 1 ) Then
      Begin
              If (  CE  = 1 ) Then {manage one entry}
              If (  CE  = 2 ) Then {Manage two entries }
              If (  CE  = 3 ) Then {Manage three entries }
      End
      Else If ( MP = -1 ) Then
      Begin
              If (  CE  = 1 ) Then {manage one entry}
              If (  CE  = 2 ) Then {Manage two entries }
              If (  CE  = 3 ) Then {Manage three entries }
      End


Thank Jeff

As mention is EL reference, This solution is only applicable in the development and evaluation stage. It could not be applied in live trading

 
Code
                            
[LEFT]CurrentEntries (Reserved Word)
Disclaimer
Returns the number of entries currently open within a position
.
Remarks
This 
function can only be used in the evaluation of strategies.
Example[/LEFT]
CurrentEntries returns a value of 3 if the strategy has made 3 entries in the current open position
Martin

Reply With Quote
 
  #8 (permalink)
 Vendor: www.systemtradersuccess.com 
Gurnee, IL
 
Futures Experience: Advanced
Platform: TradeStation
Broker/Data: TradeStation
Favorite Futures: Futures
 
Posts: 46 since Apr 2010
Thanks: 17 given, 92 received


arjfca View Post
Thank Jeff

As mention is EL reference, This solution is only applicable in the development and evaluation stage. It could not be applied in live trading

 
Code
                            
[LEFT]CurrentEntries (Reserved Word)

Disclaimer
Returns the number of entries currently open within a position
.
Remarks
This 
function can only be used in the evaluation of strategies.
Example[/LEFT]
CurrentEntries returns a value of 3 if the strategy has made 3 entries in the current open position
Martin

Matrin,

In this case I think you have to label each new entry with an entry label (buy "LE1", buy "LE2", buy "LE3 ...). You'll have to be clever and place these orders with their unique label based on the current shares or contracts you are currently holding. In the end you will have 10 such labels.

Then you can reference each entry as an individual trade with the "From Entry" command such as ...

Sell 1 contract from entry ("LE2") next bar at market ;

In this case the contract from the second buy order is sold at market.

I have not personally coded multi-entry and multi-exits strategies, so I'm not sure if this will work. If I get some time this weekend I can try to code it up and test it.

I have done single entry, multi-exit, but this is different. Hope this helps.

Reply With Quote
The following 2 users say Thank You to Jeff65 for this post:
 
  #9 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: Interactive Broker
Favorite Futures: Forex
 
Posts: 262 since Sep 2010
Thanks: 436 given, 86 received

Good day Jeff / Mike and others

Some code has been developed for me using this approach. Each entry having a different name. Up to to entry's per sides. But the problem persist as the orders are done at market. I'm looking for a limit or stop orders.

With these conditionnals entrys, if price not reach, orders are cancelled. No problem as this is done by MC. Order are canceled automatically at the end of a period if not execute. My interrogation is about orders that where executed. I need a flag or a variable that will confirm it. A unique flag to a unique reason for this entry

A solution could be to compare how many contract in the account before sending the order and comparing at the end. This wont produce a solid system as there is no direct link from an order to the entry. If two programmed systems where issuing similar quantity order, but at a different price and only one was executed, it would be difficult to attribute a position to is system. As entry price could be different as the calculated one.

My conceptual solution could be to ( I dont know if it is possible with MC)
- Issue an order
- Capture the order number from broker
- Capture and read back after each period a trade journal where , executed orders are linked to a new position and a new position number related to it.
- From my database ( array) compare the executed order and attach it to the new position number.

Being able to do it, it will create a solid and accurate plateform. Where orders and positions are linked.

Easier said than done for me. I'm not a programmer and I'm new with MC. I was doing it manually before. A verry fastudious job.

Quest continu.

Martin

Reply With Quote
 
  #10 (permalink)
 Vendor: www.systemtradersuccess.com 
Gurnee, IL
 
Futures Experience: Advanced
Platform: TradeStation
Broker/Data: TradeStation
Favorite Futures: Futures
 
Posts: 46 since Apr 2010
Thanks: 17 given, 92 received



arjfca View Post
Good day Jeff / Mike and others

Some code has been developed for me using this approach. Each entry having a different name. Up to to entry's per sides. But the problem persist as the orders are done at market. I'm looking for a limit or stop orders.

With these conditionnals entrys, if price not reach, orders are cancelled. No problem as this is done by MC. Order are canceled automatically at the end of a period if not execute. My interrogation is about orders that where executed. I need a flag or a variable that will confirm it. A unique flag to a unique reason for this entry

A solution could be to compare how many contract in the account before sending the order and comparing at the end. This wont produce a solid system as there is no direct link from an order to the entry. If two programmed systems where issuing similar quantity order, but at a different price and only one was executed, it would be difficult to attribute a position to is system. As entry price could be different as the calculated one.

My conceptual solution could be to ( I dont know if it is possible with MC)
- Issue an order
- Capture the order number from broker
- Capture and read back after each period a trade journal where , executed orders are linked to a new position and a new position number related to it.
- From my database ( array) compare the executed order and attach it to the new position number.

Being able to do it, it will create a solid and accurate plateform. Where orders and positions are linked.

Easier said than done for me. I'm not a programmer and I'm new with MC. I was doing it manually before. A verry fastudious job.

Quest continu.

Martin

My code example below was written before I read your most recent post. Anyway, it is an example of naming entry orders and using the "from entry" syntax to exit. All orders are done at market.

Place this system on the daily bar chart of S&P Emini and watch the money roll in! You can pay me my fee later.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).
It buys 1 contract when the RSI falls below 10 and another contract when it falls below 5. It only takes trades when price is above the 200-period simple moving average. Two independent exits are triggered when price closes above a their respected moving average. Oh, be sure to set your pyramiding configuration on your chart to "2" or this strategy will not work.

As for your most recent post, I may be confused, but this is my understanding. You are entering on limit orders correct? You want to verify that each limit order was actually filled, correct? Is this what you mean when you say you want a "flag" to confirm an entry? If this is true and you know how many contracts you place at each entry point than you can use currentcontracts to interrogate how many of your limit orders have been filled. Am I understanding you correctly?

 
Code
Input: Lookback(2), ExitBars(5);

Variables: Exit1(0), Exit2(0), MP(0), RSI_Value(0), MA200(0);

RSI_Value   = RSI( Close,Lookback );
MA200       = Average( Close, 200 );
Exit1       = Average( Close, 10 );
Exit2       = Average( Close, 5 );
MP          = MarketPosition;

// Enter first position when we first go below threshold 10 on rsi
If (  RSI_Value <= 10 ) And ( Close > MA200 ) And ( MP = 0 ) Then 
   buy ("LE1") 1 contract this bar at close;

// Enter second position if we go below threshold 5 on rsi
If (  RSI_Value <= 5 ) And ( Close > MA200 ) Then
   buy ("LE2") 1 contract this bar at close;

// Exit contracts from LE2 when hit exit price
If ( MP = 1 ) And ( CurrentContracts = 2 ) And ( Close > Exit2 ) Then 
   Sell from entry ("LE2" ) this bar at close;
   
// Exit contracts from LE1 when hit exit price
If ( MP = 1 ) And ( CurrentContracts = 1 ) And ( Close > Exit1 )Then 
   Sell from entry ("LE1" ) this bar at close;

Reply With Quote
The following 2 users say Thank You to Jeff65 for this post:

Reply



futures io > > > > > Using Limit entry, how to know if entry was execute - Multicharts

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chasing a limit order entry in an auto-strategy nanobiotech Elite Automated Trading 7 August 17th, 2011 06:39 AM
MULTIPLE ORDER ENTRY gparkis NinjaTrader 9 May 17th, 2011 11:25 AM
BEST BEST Entry Signal dimitri The Elite Circle 11 January 28th, 2011 07:47 AM
Entry Bars phyzfer NinjaTrader Programming 2 July 17th, 2010 12:49 AM


All times are GMT -4. The time now is 01:23 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-14 in 0.15 seconds with 19 queries on phoenix via your IP 54.234.255.29