Stop limit orders in MC strat - futures io
futures io futures trading



Stop limit orders in MC strat


Discussion in EasyLanguage Programming

Updated by aczk
    1. trending_up 10,003 views
    2. thumb_up 9 thanks given
    3. group 2 followers
    1. forum 13 replies
    2. attach_file 2 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

Stop limit orders in MC strat

(login for full post details)
  #1 (permalink)
London, UK
 
Experience: Intermediate
Platform: MultiCharts
Trading: equities, futures
 
Posts: 36 since Jan 2012
Thanks: 3 given, 2 received

Hi
Trying to get this to work:

After buy signal on bar one, submit a stop limit order at the high price of the signal bar for the next bar, to catch a breakout.

If the stoplimit order is submitted but not filled after lets say 2 bars, then I want to cancel it.

thx appreciate any feedback!

Reply With Quote

Can you help answer these questions
from other members on futures io?
Where is the link to download GomiRecorder?
NinjaTrader
IB Bracker Order
Platforms and Indicators
OPEN_CLOSE_DOTS
ThinkOrSwim
Webinar: Linda Bradford Raschke Dealing with August burnout and Trader Camaraderie
The Elite Circle
TraderSync Experience?
Trading Reviews and Vendors
 
 
(login for full post details)
  #3 (permalink)
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
 
Nicolas11's Avatar
 
Posts: 1,071 since Aug 2011
Thanks: 2,232 given, 1,746 received


Hi!

What is your current code?

Nicolas

Envoyé depuis mon GT-I9100 avec Tapatalk

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #4 (permalink)
London, UK
 
Experience: Intermediate
Platform: MultiCharts
Trading: equities, futures
 
Posts: 36 since Jan 2012
Thanks: 3 given, 2 received

inputs: SellBars(3),Threshold (10);

value1=ThreeBarPattern(0);

if value1 < Threshold and marketposition = 0 then buy next bar at high stop high limit ;


if value1 < Threshold and marketposition = 0 then sellshort next bar at low stop low limit;


setexitonclose;
setbreakeven(75);


Basic skeleton code for now, stuck on the stoplimiting!

Signal bar is determined by value1 then I want to buy/short the breakout of the next bar with a limit stop just above/below the signal bar's high/low. On the picture the lines indicate pretty much what the limit order are meant to catch. So should be stop limits right!?!?


Reply With Quote
 
(login for full post details)
  #5 (permalink)
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
 
Nicolas11's Avatar
 
Posts: 1,071 since Aug 2011
Thanks: 2,232 given, 1,746 received

OK.

Do you really need a stop-limit entry? Isn't a stop entry enough?

Anyway, what exactly does not work? In other words: what is the problem?
The orders are not executed?
You just want to add the feature "after 2 bars, cancel it"?

Nicolas

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #6 (permalink)
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
 
Nicolas11's Avatar
 
Posts: 1,071 since Aug 2011
Thanks: 2,232 given, 1,746 received

In order to help you, below please find an example of code.

The signal is: two HH in a row (= 2 bars with a H higher than the bar before)
In case of signal, entry long next bar with a stop order at the H of the current bar (your breakout)
The signal is valid for 3 bars (the entry level remains the H of the signal pattern, not the H of the last bar).

I do not say that this code is perfect. I've prepared it in 10 minutes. But it can give you food for thought.

Nicolas


Quoting 
Inputs:
NumberBarsLimit ( 4 ),
TextBold ( true ),
TextColor ( red ),
TextOffsetInTicks ( 4 );

Variables:
TickSize ( MinMove / PriceScale ),
NumberOfBarsSinceBuySetup ( 0 ),
SetupHigh ( 0 );

// if we already have an open long position, no need to count:
if MarketPosition = 1 then begin
NumberOfBarsSinceBuySetup = 0;
end;

// increase the counter of bars since the setup was identified:
if NumberOfBarsSinceBuySetup > 0 then begin
NumberOfBarsSinceBuySetup = NumberOfBarsSinceBuySetup + 1;
end;

// if the counter reaches its limit, put it back to zero:
if NumberOfBarsSinceBuySetup = NumberBarsLimit then begin
NumberOfBarsSinceBuySetup = 0;
end;

// setup = buy after two HH in a row:
if MarketPosition = 0 AND NumberOfBarsSinceBuySetup = 0 AND H > H[1] AND H[1] > H[2] then begin
NumberOfBarsSinceBuySetup = 1;
SetupHigh = High;
end;

// entry long:
if MarketPosition = 0 AND NumberOfBarsSinceBuySetup > 0 then Buy next bar at SetupHigh stop;

// exit after two bars:
if MarketPosition = 1 AND BarsSinceEntry >= 2 then Sell next bar at market;

// display the value of the counter on the screen:
if NumberOfBarsSinceBuySetup > 0 then begin
Value2 = Text_New_s(Date, Time_s, L - TextOffsetInTicks * TickSize, NumToStr(NumberOfBarsSinceBuySetup, 0));
Text_SetColor(Value2, TextColor);
Text_SetAttribute(Value2, 1, TextBold);
end;


Visit my futures io Trade Journal Reply With Quote
The following 4 users say Thank You to Nicolas11 for this post:
 
(login for full post details)
  #7 (permalink)
London, UK
 
Experience: Intermediate
Platform: MultiCharts
Trading: equities, futures
 
Posts: 36 since Jan 2012
Thanks: 3 given, 2 received

thx for this. but doesn't this strat just place a stop buy order at the high.

I am looking to put a buy limit order at that spot!

Reply With Quote
 
(login for full post details)
  #8 (permalink)
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
 
Nicolas11's Avatar
 
Posts: 1,071 since Aug 2011
Thanks: 2,232 given, 1,746 received

Hi @aczk,

Could you kindly clarify?

1. Do you want to place
(a) a limit order (as you said in that message)
or
(b) a stop limit order (as you said in the first message of the thread)?

2. If (b), the stop and the limit orders are both are High of the current bar?

Nicolas

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #9 (permalink)
London, UK
 
Experience: Intermediate
Platform: MultiCharts
Trading: equities, futures
 
Posts: 36 since Jan 2012
Thanks: 3 given, 2 received

1 (a) to buy highs a stop limit order as we are still below that price!
2 at the high of this bar
thx

Reply With Quote
 
(login for full post details)
  #10 (permalink)
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
 
Nicolas11's Avatar
 
Posts: 1,071 since Aug 2011
Thanks: 2,232 given, 1,746 received


Hi,

I'm lost. You refer to 1.(a) and "stop limit order" whereas "stop limit order" was 1.(b).
Sorry about my questions: I just want to understand what you want, and it is still unclear.

Nicolas

Visit my futures io Trade Journal Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Stop limit orders in MC strat


June 19, 2012


Upcoming Webinars and Events
 

Dealing with burnout w/Linda Bradford Raschke

Elite only
     



Copyright © 2020 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