RISTRICTING ENTRY LIMIT ORDER TO ONE BAR ONLY - MultiCharts | futures io social day trading
futures io futures trading


RISTRICTING ENTRY LIMIT ORDER TO ONE BAR ONLY
Updated: Views / Replies:137 / 5
Created: by Tiforp 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
 

RISTRICTING ENTRY LIMIT ORDER TO ONE BAR ONLY

  #1 (permalink)
Trading Apprentice
Cambridge, UK
 
Futures Experience: None
Platform: Multicharts
 
Posts: 5 since Jun 2010
Thanks: 1 given, 1 received

RISTRICTING ENTRY LIMIT ORDER TO ONE BAR ONLY

I am frustrated when unfilled limit or stop entry orders carry on to the next bar. It does not happen to often, but is quite troublesome when it does.

Therefore, I shall be very appreciative for programming help to ensure via strategy code so any unfilled entry position stop order / limit order is cancelled at the end of day, or bar, and does not carry to the next session.

Below are two entry instructions examples:
  1. sellshort next bar at open next bar + .05 Limit;
  2. if condition1 = true then buy next bar at currentbid limit;

Thank you in advance.

Tiforp

Reply With Quote
 
  #2 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,604 since Apr 2013
Thanks: 242 given, 896 received
Forum Reputation: Legendary

Tiforp,

Multicharts will keep an order alive as along as the condition that triggered the order is valid. You can use this by adding a condition to your order that you set to false X bars after you set it to true. You could for example store the bar number when you want to issue the order in a variable (let's call it "longOrderBar"). Then check for the current bar being equal to this variable before you issue your order - this wouldn't require resetting the condition,
as it becomes false on subsequent bars.

 
Code
if CurrentBar = longOrderBar then
 SellShort...
Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #3 (permalink)
Trading Apprentice
Cambridge, UK
 
Futures Experience: None
Platform: Multicharts
 
Posts: 5 since Jun 2010
Thanks: 1 given, 1 received



ABCTG View Post
Tiforp,

Multicharts will keep an order alive as along as the condition that triggered the order is valid. You can use this by adding a condition to your order that you set to false X bars after you set it to true. You could for example store the bar number when you want to issue the order in a variable (let's call it "longOrderBar"). Then check for the current bar being equal to this variable before you issue your order - this wouldn't require resetting the condition,
as it becomes false on subsequent bars.

 
Code
if CurrentBar = longOrderBar then
 SellShort...
Regards,

ABCTG

ABCTG,

Thank you for your help. Verpflichtet.

Reply With Quote
The following user says Thank You to Tiforp for this post:
 
  #4 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,604 since Apr 2013
Thanks: 242 given, 896 received
Forum Reputation: Legendary

Tiforp,

you are welcome.

Regards,

ABCTG

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Cambridge, UK
 
Futures Experience: None
Platform: Multicharts
 
Posts: 5 since Jun 2010
Thanks: 1 given, 1 received

ABCTG,

After you kind reply I did try to write a working code, but obviously have missed certain key elements because it complies but does not execute any trades. Most probably I have missed out correctly completing the “CurrentBar” and “longOrderBar”:

1. CurrentBar[ StdFunction ] : Return(Numeric)
2. longOrderBar[ Variable ] : NumericSimple

It appears simple enough, but I cannot seem to make any progress!

My full code is included. Any help once again shall be greatly appreciate.

Thank you.

 
Code
Inputs: 
MyContracts (1          { Indicate number of contracts to trade}),
StartTime   (900       { Designate valid intraday start-trading time}),
NumBarsP    (5          { Number of bars since entry});

Variables:
longOrderBar (0         { To ensure any unfilled entry order is not carried to the next bar });
     
If ( Time = StartTime )and CurrentBar[0] = longOrderBar Then  
     Begin
          SellShort("")  MyContracts Contracts next bar at CurrentAsk Limit;
     End;
     
 { --- Exit at N bars since entry --- }
      
 If ( NumBarsP > 0 ) Then
     Begin
          If marketposition = -1 and BarsSinceEntry >= NumBarsP Then Buytocover("Stop") MyContracts contracts next bar at Market;      
     End;

Reply With Quote
 
  #6 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,604 since Apr 2013
Thanks: 242 given, 896 received
Forum Reputation: Legendary

Tiforp,

you can use the print reserved word, to check the values of the variables in your code on every bar.

As I wrote above "You could for example store the bar number when you want to issue the order in a variable (let's call it "longOrderBar")." Your code doesn't store the bar number when you want to issue the order. That's what you will have to do first, before checking for CurrentBar = longOrderBar. Otherwise longOrderBar will have a value of 0. CurrentBar on the other hand will always be greater than 0 and in turn your condition will never be true and you would see no trade entries.

From looking at your code and under the condition that you are on time based intraday charts, checking for "( Time = StartTime )" should be true only once per day. Which would already limit the order to one bar.

Regards,

ABCTG

Reply With Quote

Reply



futures io > > > > RISTRICTING ENTRY LIMIT ORDER TO ONE BAR ONLY

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

CME Group: Futures & Bitcoin

Elite only

Ran Aroussi: TBA [special time 11AM ET]

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Limit Order Fill Probabilities for different Entry Types? iantg NinjaTrader 7 February 17th, 2016 12:34 PM
Stop vs Limit order for Entry, a Thought Experiment treydog999 Traders Hideout 5 January 20th, 2015 09:36 AM
Include Commissions in Limit Price at Order Entry TraitorX IB Trader Workstation 0 January 7th, 2014 04:16 PM
Inside Bar order entry chris2980 EasyLanguage Programming 3 September 25th, 2012 10:15 PM
Chasing a limit order entry in an auto-strategy nanobiotech Elite Automated Trading 7 August 17th, 2011 06:39 AM


All times are GMT -4. The time now is 04:01 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 2018-02-23 in 0.06 seconds with 18 queries on phoenix via your IP 54.163.53.153