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,096 / 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

  #21 (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

I will try to test it live later in the day.

(i) Sorry if I force you to repeat, but just for confirmation: the "pending orders" are the entry orders, correct?

(ii) I understand that, for your live trading, you are connected to your broker in sim mode. Correct? Which broker is it?

Nicolas

Reply With Quote
 
  #22 (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

1.Yes the pending orders are my entry orders.

2.Yes i am connected to my broker which is OEC in sim also.



Nicolas11 View Post
I will try to test it live later in the day.

(i) Sorry of I force you to repeat, but just for confirmation: the "pending orders" are the entry orders, correct?

(ii) I understand that, for your live trading, you are connected to your broker in sim mode. Correct? Which broker is it?

Nicolas


Reply With Quote
 
  #23 (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


I still not succeed in reproducing your problem.

I have used the following signal in real-time sim mode, connected to my broker (Interactive Brokers).
Instrument is EUR.USD.
Timeframe is 1 minute.

The "condition" becomes true a few minutes after the activation of the strategy.
But the entry is impossible (the required entry price is set @ 1000 ticks above current price).
 
Code
[IntraBarOrderGeneration = false]

Variables:
    TickSize        ( MinMove / PriceScale ),
    NbContracts        ( 10000 ),
    NotAlreadyDone    ( true );
    
if Date = 1120131 AND Time >= 1313 AND NotAlreadyDone {to be sure the test will be done only once} AND MarketPosition = 0 then begin
    Buy ("Entry LONG") NbContracts contracts next bar at H + 1000 * TickSize or higher {virtually impossible};
    NotAlreadyDone = false;
end;

if MarketPosition = 1 AND BarsSinceEntry >= 1 then
    Sell ("Time Exit LONG") next bar at market; // actually never used since no entry triggered
MultiCharts has generated the buy order. This order could not be executed since the required price was too high. After one minute, the order has been automatically cancelled by MultiCharts. Evidence in MC's "Order Position Tracking window" with the "Cancelled" status:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Same behaviour (order then cancellation of the order) has been noticed in the broker's software, not shown here.

Nicolas

Reply With Quote
The following user says Thank You to Nicolas11 for this post:
 
  #24 (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

Im wondering if this is a broker issue then. Ill have to ask my broker.

How would your code it if you wanted it one way vs the other.

1. if condition is met then pending orders stay there forever until executed or new condition is there.

2.if condtion is met then pending orders stay valid for 1 hour only then cancels.

How would the coding be for each?




Nicolas11 View Post
I still not succeed in reproducing your problem.

I have used the following signal in real-time sim mode, connected to my broker (Interactive Brokers).
Instrument is EUR.USD.
Timeframe is 1 minute.

The "condition" becomes true a few minutes after the activation of the strategy.
But the entry is impossible (the required entry price is set @ 1000 ticks above current price).
 
Code
[IntraBarOrderGeneration = false]
 
Variables:
    TickSize        ( MinMove / PriceScale ),
    NbContracts        ( 10000 ),
    NotAlreadyDone    ( true );
 
if Date = 1120131 AND Time >= 1313 AND NotAlreadyDone {to be sure the test will be done only once} AND MarketPosition = 0 then begin
    Buy ("Entry LONG") NbContracts contracts next bar at H + 1000 * TickSize or higher {virtually impossible};
    NotAlreadyDone = false;
end;
 
if MarketPosition = 1 AND BarsSinceEntry >= 1 then
    Sell ("Time Exit LONG") next bar at market; // actually never used since no entry triggered
MultiCharts has generated the buy order. This order could not be executed since the required price was too high. After one minute, the order has been automatically cancelled by MultiCharts. Evidence in MC's "Order Position Tracking window" with the "Cancelled" status:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Same behaviour (order then cancellation of the order) has been noticed in the broker's software, not shown here.

Nicolas


Reply With Quote
 
  #25 (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


guppy View Post
1. if condition is met then pending orders stay there forever until executed or new condition is there.

I would do something similar to the following, not tested.

 
Code
Variables:
    Setup    ( false );
    
If L > L[1] AND H < H[1] {inside bar; substitute by what you want} then begin
    Setup = true;
end;

If Setup AND MarketPosition = 0 then begin
    Buy next bar at market;
end;

// if order executed, then set the condition at false:
If Setup AND MarketPosition = 1 then begin
    Setup = false;
end;

// if "other condition", then set the condition at false:
If Setup AND L < L[1] AND H > H[1] {outside bar; substitute by what you want} then begin
    Setup = false;
end;

// inspired by http://www.breakoutfutures.com/Newsletters/Newsletter0103.htm

guppy View Post
2.if condtion is met then pending orders stay valid for 1 hour only then cancels.

I would do something similar to the following, not tested.

 
Code
Variables:
    Setup            ( false ),
    SetupBarNumber    ( 0 );
    
If L > L[1] AND H < H[1] {inside bar; substitute by what you want} then begin
    Setup = true;
    SetupBarNumber = BarNumber;
end;

If Setup AND MarketPosition = 0 then begin
    Buy next bar at market;
end;

// if order executed, then set the condition at false:
If Setup AND MarketPosition = 1 then begin
    Setup = false;
end;

// if other condition, then set the condition at false:
If Setup AND L < L[1] AND H > H[1] {outside bar; substitue by what you want} then begin
    Setup = false;
end;

// if 12 bars have elapsed, then set the condition at false:
If Setup AND BarNumber >= SetupBarNumber + 12 then begin
    Setup = false;
end;
Another way would be to identify how many bars ago the condition was true (with a function like "MRO"), check that it occurred less than 12 bars ago, and check that no trade was done between this most recent time the condition was true and now.

Nicolas

Reply With Quote
The following user says Thank You to Nicolas11 for this post:
 
  #26 (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

This was definetly an issue and multicharts support confirmed what i was originally saying. They (Henery) at multicharts support after testing verified it and gave me a hot fix as other people were having and issue with it also. The future versions of multicharts will have this flaw/bug removed they told me.





Nicolas11 View Post
I still not succeed in reproducing your problem.

I have used the following signal in real-time sim mode, connected to my broker (Interactive Brokers).
Instrument is EUR.USD.
Timeframe is 1 minute.

The "condition" becomes true a few minutes after the activation of the strategy.
But the entry is impossible (the required entry price is set @ 1000 ticks above current price).
 
Code
[IntraBarOrderGeneration = false]
 
Variables:
    TickSize        ( MinMove / PriceScale ),
    NbContracts        ( 10000 ),
    NotAlreadyDone    ( true );
 
if Date = 1120131 AND Time >= 1313 AND NotAlreadyDone {to be sure the test will be done only once} AND MarketPosition = 0 then begin
    Buy ("Entry LONG") NbContracts contracts next bar at H + 1000 * TickSize or higher {virtually impossible};
    NotAlreadyDone = false;
end;
 
if MarketPosition = 1 AND BarsSinceEntry >= 1 then
    Sell ("Time Exit LONG") next bar at market; // actually never used since no entry triggered
MultiCharts has generated the buy order. This order could not be executed since the required price was too high. After one minute, the order has been automatically cancelled by MultiCharts. Evidence in MC's "Order Position Tracking window" with the "Cancelled" status:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Same behaviour (order then cancellation of the order) has been noticed in the broker's software, not shown here.

Nicolas


Reply With Quote
 
  #27 (permalink)
Elite Member
London
 
Futures Experience: None
Platform: .
Favorite Futures: .
 
Posts: 162 since Apr 2011
Thanks: 46 given, 107 received


nismo View Post
3. Is there any 'best practises' when using limit orders?

Yes there is:

Buy Stop and Sell Stop orders... 99% of the time, I would say 100% of the time you will get filled.

If you are using Limits Orders most likely you will not get filled, mainly if price is moving fast or there is a spike; Limits Orders never worked for me.

Now, after I am in a position then I use Limit Orders to take some profits [Sell Limit and But Limit], but for entries ONLY Buy Stop and Sell Stop.

I am will MB Trading as well and the majority of the time they did not fill my Limits Orders, it was really really really frustrating. Like a trade that could have made me some nice profit...

They say: We pay for Limits!!! Pfff... who cares you pay for Limits Orders, once your orders won't get fill anyway.

About your 20 pips slippage, I trade with MB for a while now and I never seen that, however one day I had 12 pip slippage on the AUD/USD I call them immediately: They say it was a news event and then I say that there are news event every single day and please never do that again.


Last edited by mrphr; March 1st, 2012 at 03:04 PM.
Reply With Quote
 
  #28 (permalink)
Elite Member
London
 
Futures Experience: Beginner
Platform: MultiCharts
 
Posts: 230 since Nov 2010
Thanks: 10 given, 20 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.

It was good but then it is difficult to keep it aligned with the MC. In MC orders only post them on Data1 and for BID and ASK you have to put even Data2. How could we do?
You could try to put two charts in the WS ....
We can also add the sort of excursion of the time, where the pricegap becomes greater if the time grows, the less if it goes down, just that this is above my current abilities.
Any suggestion?

Reply With Quote
 
  #29 (permalink)
Elite Member
London
 
Futures Experience: Beginner
Platform: MultiCharts
 
Posts: 230 since Nov 2010
Thanks: 10 given, 20 received

Guppy
Original code:

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,

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

I think, but probably I am wrong that code is wrong.
In your code if you work with 1 lot = 100.000
0.0005 is equal to 50 $ and not 500$
Nicolas the time frame should be 1 hours and not 5 minutes.
Guppy use a monetary stop e target of 500$ so the set should change.
I think that you should write 0.0050, nut is bettter use 500 no avoid mistakes.


I use tradestation and for default the minim lot size is minilot = 10.000 so
0.0005 = 5$.
If we trade FX eurusd and we want trade 10.000 eurs or 1 minilot it should be

 
Code
//
// EUR.USD
input: SPT(500), SSL(500), cts(10000);
Condition1 = H < H[1] and L > L[1];
if MarketPosition = 0 and Condition1 then
buy ("IB Break")  cts contracts next bar at H + 0.0001 stop ;
SetProfitTarget(SPT);
SetStopLoss(SSL);

In the following image i post charts, the time frame is daily because the value of
SetProfitTarget(SPT);
SetStopLoss(SSL);
=500 is to big and trade is executed at 1 hour time frame.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Attached Files
Register to download File Type: xlsx rep.xlsx (42.7 KB, 5 views)

Last edited by bomberone1; April 4th, 2013 at 07:19 AM.
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 02:19 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-15 in 0.14 seconds with 20 queries on phoenix via your IP 54.82.56.95