EasyLanguage, Mulitcharts and Limit Orders - EasyLanguage Programming | futures io social day trading
futures io futures trading


EasyLanguage, Mulitcharts and Limit Orders
Updated: Views / Replies:12,109 / 28
Created: by nismo Attachments:4

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
 4  
 
Thread Tools Search this Thread
 

EasyLanguage, Mulitcharts and Limit Orders

  #11 (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,353 given, 83,234 received

Buy 1 Contract Next Bar at 1.4450 Limit;

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
 
  #12 (permalink)
Fortitudo et Honor
Austin, TX
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 882 since Mar 2011
Thanks: 128 given, 703 received

I recommend issuing orders at the bid/ask and applying some sort of momentum cushion.

In high velocity markets, your limit order can get skipped if you try to issue at an open price.


inputs: pricegap(.01);

If (entry criteria) then buy next bar at currentask + pricegap;
If (entry criteria) then sellshort next bar at currentbid - pricegap;

etc.

you can also make pricegap a variable that adjusts according to the market volitility/velocity. In higher velocity markets, it can be larger and it slow markets, you can have it converge to zero.

Also, with tradestation, limit order does not equal "limit if touched."

They make it really complicated, so you should research on MC to ensure that the two are analogous.

A limit if touched order only gets issued if the price is touched. A limit order gets submitted immediately.

The difference might seem trivial, but it's relevant when trying to implement additional risk management.

TS limits orders from being issued more frequently than 15 seconds apart. Anything beyond 15 seconds, TS will maintain the order on their stop server. If you violate the 15 second rule, the order will be maintained on your machine. In the event that your machine crashes or loses connection, orders that are not maintained at the stopserver will not be valid.

You should verify with MC if there are similar limitations.

Obviously, depending on your trading style, risk tolerance, money management, trading hours, etc, one or the other might be preferable.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
The following 3 users say Thank You to RM99 for this post:
 
  #13 (permalink)
Trading Apprentice
Australia
 
Futures Experience: Beginner
Platform: Multicharts
Favorite Futures: forex
 
Posts: 32 since Dec 2010
Thanks: 7 given, 3 received



RM99 View Post
I recommend issuing orders at the bid/ask and applying some sort of momentum cushion.

In high velocity markets, your limit order can get skipped if you try to issue at an open price.


inputs: pricegap(.01);

If (entry criteria) then buy next bar at currentask + pricegap;
If (entry criteria) then sellshort next bar at currentbid - pricegap;

etc.

you can also make pricegap a variable that adjusts according to the market volitility/velocity. In higher velocity markets, it can be larger and it slow markets, you can have it converge to zero.

Great post thats exactly what I was getting at with your suggestion of pricegap in my first post, point 2.

Also using currentask and currentbid seems better.

Say you've got a chart that is set to bid and you issue a limit order based on the current bid price I'm guessing its going to get missed straight away as the ask price will be higher by what ever the spread is...

Reply With Quote
 
  #14 (permalink)
Fortitudo et Honor
Austin, TX
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 882 since Mar 2011
Thanks: 128 given, 703 received


nismo View Post
Great post thats exactly what I was getting at with your suggestion of pricegap in my first post, point 2.

Also using currentask and currentbid seems better.

Say you've got a chart that is set to bid and you issue a limit order based on the current bid price I'm guessing its going to get missed straight away as the ask price will be higher by what ever the spread is...

If you're issuing on the momentum side, just be aware that your pricegap is slippage, just in deliberate form.

In a sense, you're avoiding slippage from market orders, but at the cost of the pricegap. This type of approach is mainly needed once your order sizes start getting large enough to see more than a tick of slippage.

If you're trading during high volume periods, on liquid instruments, this will usually mean some pretty large orders before the limit approach is necessary.

If you're trading off hours, then this approach will be necessary earlier (or with smaller positions).

Also know that limit order execution complicates matters, as you have the issues associated with partial fills.

The good thing is that momentum (or windward) side orders, partial fills are a good thing. A partial fill on an entry, means the market partially filled you and then moved against you, so you entered a smaller position on a loss. A partial fill on profitable exit means you didn't get "limited out" and the trade continues in your favor. A partial fill on loss exit means you survived to fight some more.

Bear in mind that TS has some settings associated with limit orders and partial fills. You need to check and ensure you're on top of MC's settings. You can set it to automatically convert to a market order after a certain amount of time, you can cancel the remaining order if price moves away, etc.

Also, bear in mind that momentum side limit orders still exhibit slippage. I call it momentum slippage. Essentially, the order gets translated from your platform, to the broker, then to the exchange. If you issue the order to the broker at say $0.00 (a buy order on an upward trend). During high velocity market conditions, the price may have moved by the time the broker was able to issue the order to the exchange. So your order may actually get filled at some price higher than $0.00. This is called momentume slippage and it hurts you on momentum side entries and exits.

So keep all this in mind with your limit strategies. Generally, limit orders are necessary (and all the headaches) for larger positions. If you're trading a small position, it's almost always better to just bite the bullet and go with market orders.

Simulation cannot accurately account for variances you'll see with either approach. Sim cannot adequately calculate market order slippage (although you can place the settings to only fill once price has moved at least a tick beyond your order). It also cannot account for live limit slippage (that I covered above).

So you'll see some variance from sim to live. You need to ensure that your net profit/trade is adequate enough to suffer SOME amount of platform-broker-exchange lag (momentum slippage).

I generally backtest with commission plus a tick on each side (for my pricegap) and then if my performance is still satisfactory if I add another tick on each side (for platform lag) then it's tough enough to think about taking live.

If you're strategy with commissions, doesn't yield more than 4 or 5 ticks per trade (net), I'd be very wary about putting any more time or energy into it....as even a small amount of platform variance can really ruin your day. At least it totally wrecks your drawdown, at worst it can totally ruin your profitability.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
The following 2 users say Thank You to RM99 for this post:
 
  #15 (permalink)
Elite Member
Ann Arbor, Michigan USA
 
Futures Experience: Advanced
Platform: TradeStation, Biocomp
Favorite Futures: TF
 
Posts: 19 since Aug 2010
Thanks: 61 given, 21 received

I have come to the conclusion that proper simulation of real time trading means using at least the OPEN of the next bar as the closing price of the prior bar, especially when trading at even intervals of time like 5 minute or 30 minute bars, if not many ticks of delay as proxy for the close of the prior bar. You want YOUR strategy bar close to sync up with its arrival at your counterparty's bid or offer.

Experiment: Take any strategy that allows trades to commence at the daily open, (regular Session).

Compare results of that same strategy using a custom Session starting time whose intervals are displaced just ONE minute later or earlier in time by starting the Session a minute early or late. Same trick may show difference at the daily Close.

I sometimes see multi-tick gaps between 1 minute bars prior bar close and next bar open. Right where I get signals....and the market leaps.... These little details need to be taken into your strategy's thoughtful consideration along with transmission and computer latency and positioning in limit order book queue.

Reply With Quote
 
  #16 (permalink)
Elite Member
Los Angeles, CA
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: Tradestation
Favorite Futures: ES,HG,GC,YM,Nq,RB,NG
 
Posts: 52 since Aug 2011
Thanks: 11 given, 8 received

Mike in red below you said that all orders are canceled and replaced at the start of each new bar. But I dont see it happend way. For example i have coded a breakout strategy to take the break of an inside bar high + 1 tick. If my condition is met the pending order is placed. However if the price never touches the price the pending order is still there for hours which I only want the pending order to be there for one hour. How do I get it to be there so its not there indefinetly?



Big Mike View Post
All orders are canceled and replaced at the start of each new bar. To cancel it in effect, just don't reissue the Buy or Sell order.

You said you are seeing 1-5 pips slippage. 5 is quite a bit. What instrument and during what time frame? You will always see 1 tick "slippage" which is the price you pay for a market order. Most futures you shouldn't see more than two ticks. If you are trading something very thin, like Micro's on CME, then you can easily see spreads of 4-6 ticks especially after hours. A limit order is not likely to help you, the order simply won't get filled.

Mike


Reply With Quote
 
  #17 (permalink)
Elite Member
near Paris, France
 
Futures Experience: Beginner
Platform: -
Favorite Futures: -
 
Nicolas11's Avatar
 
Posts: 1,070 since Aug 2011
Thanks: 2,232 given, 1,729 received

Hi,

What is your timeframe ?
Could you post your code?

Nicolas

Reply With Quote
 
  #18 (permalink)
Elite Member
Los Angeles, CA
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: Tradestation
Favorite Futures: ES,HG,GC,YM,Nq,RB,NG
 
Posts: 52 since Aug 2011
Thanks: 11 given, 8 received

my time frame is a 1 hour chart and the code is below


vars:mystoploss(0);
condition1= h<h[1] and l>l[1];
if marketposition = 0 and condition1 then
buy ("IB Break") 1 contracts next bar at h+1 point or higher;
setprofittarget(500);
setstoploss(500);


Nicolas11 View Post
Hi,

What is your timeframe ?
Could you post your code?

Nicolas


Reply With Quote
 
  #19 (permalink)
Elite Member
near Paris, France
 
Futures Experience: Beginner
Platform: -
Favorite Futures: -
 
Nicolas11's Avatar
 
Posts: 1,070 since Aug 2011
Thanks: 2,232 given, 1,729 received

Hi,

I do not succeed in reproducing your problem.

I have applied your signal on EUR.USD 5 min:
 
Code
// EUR.USD
Condition1 = H < H[1] and L > L[1];
if MarketPosition = 0 and Condition1 then
    buy ("IB Break") 1 contracts next bar at H+1 point or higher;
SetProfitTarget(0.0005);
SetStopLoss(0.0005);
I have also added an indicator to show the IB which are not triggered on the following bar:
 
Code
Condition1 = H < H[1] and L > L[1];
if Condition1[1] AND H <= H[1] then begin
    Value1 = Arw_New(Date, Time, High+0.0003, true);
    Arw_SetText(Value1, "IB but no trigger");
end;
The results (backtesting) are as expected: when an IB does not trigger an order, such order is "forgotten" after the bar elapsed:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Nicolas

Reply With Quote
The following 2 users say Thank You to Nicolas11 for this post:
 
  #20 (permalink)
Elite Member
Los Angeles, CA
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: Tradestation
Favorite Futures: ES,HG,GC,YM,Nq,RB,NG
 
Posts: 52 since Aug 2011
Thanks: 11 given, 8 received


Nicholas,

I get the same results when backtesting. It works fine on backtesting. Its on live mode that you will see once the condition is true it will but the stop pending orders in. Once the stop pending orders are put in they will remain there indefinetely until one of two things happen. 1. the signal gets executed or 2. There is a new signal.

So for example at 5am if we get a true condition then at beginning of hour 6 the orders are in place pending at h+1. If it doesnt get executed they still stay there even if 4 hours have passed by.

Let me know if you get a chance to test the live.

Thanks



Nicolas11 View Post
Hi,

I do not succeed in reproducing your problem.

I have applied your signal on EUR.USD 5 min:
 
Code
// EUR.USD
Condition1 = H < H[1] and L > L[1];
if MarketPosition = 0 and Condition1 then
    buy ("IB Break") 1 contracts next bar at H+1 point or higher;
SetProfitTarget(0.0005);
SetStopLoss(0.0005);
I have also added an indicator to show the IB which are not triggered on the following bar:
 
Code
Condition1 = H < H[1] and L > L[1];
if Condition1[1] AND H <= H[1] then begin
    Value1 = Arw_New(Date, Time, High+0.0003, true);
    Arw_SetText(Value1, "IB but no trigger");
end;
The results (backtesting) are as expected: when an IB does not trigger an order, such order is "forgotten" after the bar elapsed:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Nicolas


Reply With Quote

Reply



futures io > > > > > EasyLanguage, Mulitcharts and Limit Orders

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
Limit Orders COTtrader Traders Hideout 17 August 22nd, 2010 03:24 PM
ATM and Limit Orders spinnybobo NinjaTrader Programming 6 June 12th, 2010 09:06 PM
Time Breakout with limit orders rajafx1 NinjaTrader Programming 1 December 23rd, 2009 03:52 PM
Limit Orders - Proving a fill zeller4 NinjaTrader Programming 1 August 28th, 2009 04:14 AM
A little trouble with limit orders... BigDog NinjaTrader Programming 8 June 21st, 2009 08:07 PM


All times are GMT -4. The time now is 05:22 AM.

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-16 in 0.22 seconds with 20 queries on phoenix via your IP 54.160.245.121