NexusFi: Find Your Edge


Home Menu

 





Stop limit orders in MC strat


Discussion in EasyLanguage Programming

Updated
    1. trending_up 13,265 views
    2. thumb_up 9 thanks given
    3. group 2 followers
    1. forum 13 posts
    2. attach_file 2 attachments




 
Search this Thread

Stop limit orders in MC strat

  #11 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

@aczk,

About stop limit orders with MultiCharts, the following thread could be worth a look : MultiCharts: Trading Software for Automated Trading and [AUTOLINK]Backtesting[/AUTOLINK] • View topic - Stop-[AUTOLINK]Limit order[/AUTOLINK] in Auto Trading

Below please find a code.

BuySetup shall be modified by you to be true when there is a setup on the current bar, and false otherwise.
In the below example, BuySetup is true if the current bar is an inside bar (more precisely: the 2nd bar of the inside bar).

BuyEntryPrice shall be modified by you to contain the entry price in case of setup. In the below example, we buy in case of breakout of the 1st bar of the IB (the tallest bar). So BuyEntryPrice = H[1].

Then, at each bar, if there was a setup at the current bar, the bar before or the 2nd bar before, a stop limit order is launched for the next bar at the "BuyEntryPrice" of the setup.

Note: with MultiCharts auto trading, the order are just valid for the next bar. They do not "stay". So, they have to be sent again at each bar, if relevant.

Nicolas

 
Code
Variables:
	BuySetup	( false ),
	BuyEntryPrice	( 0 );
	
BuySetup = H < H[1] AND L > L[1]; // inside bar
if BuySetup then BuyEntryPrice = H[1]; // highest high of the IB

if MarketPosition = 0 then begin
	if BuySetup then begin // the current bar is an IB
		Buy next bar at BuyEntryPrice stop BuyEntryPrice limit;
	end else if BuySetup[1] then begin // the bar before current bar is an IB
		Buy next bar at BuyEntryPrice[1] stop BuyEntryPrice[1] limit;
	end else if BuySetup[2] then begin // the 2nd bar before current bar is an IB
		Buy next bar at BuyEntryPrice[2] stop BuyEntryPrice[2] limit;
	end;
end;

if MarketPosition = 1 AND BarsSinceEntry = 3 then begin 
	// close the trade after 3 bars
	Sell next bar at market;
end;

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
Exit Strategy
NinjaTrader
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #12 (permalink)
 aczk 
London, UK
 
Experience: Intermediate
Platform: MultiCharts
Trading: equities, futures
Posts: 36 since Jan 2012
Thanks Given: 3
Thanks Received: 2

yep...my bad...sorry.

it is a stop limit order !
thx

Started this thread Reply With Quote
  #13 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769


OK. Please kindly refer to my last message above.

Visit my NexusFi Trade Journal Reply With Quote
  #14 (permalink)
 aczk 
London, UK
 
Experience: Intermediate
Platform: MultiCharts
Trading: equities, futures
Posts: 36 since Jan 2012
Thanks Given: 3
Thanks Received: 2

ok got it now. thx

Started this thread Reply With Quote




Last Updated on June 19, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts