Custom breakeven/takeprofit/trailingstop - MultiCharts | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > MultiCharts

Custom breakeven/takeprofit/trailingstop
Started:June 29th, 2015 (05:21 AM) by bondstrader Views / Replies:343 / 0
Last Reply:June 29th, 2015 (05:21 AM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Custom breakeven/takeprofit/trailingstop

Old June 29th, 2015, 05:21 AM   #1 (permalink)
Trading Apprentice
Dubai, UAE
Futures Experience: Advanced
Platform: Multicharts
Favorite Futures: Gold
Posts: 10 since Sep 2014
Thanks: 2 given, 1 received

Custom breakeven/takeprofit/trailingstop

Is there anything wrong with the following code?
What Im trying to do is as follows.
1. Send a long order based on required conditions.
2. Set a breakeven stop if position moves up x number of pips.
3. Set a jump signal (sort of a big one time trailing stop) if position moves certain number of pips in profit.
4. Set a regular stop loss in case position goes into a loss.
5. Set a target profit.
Breakevenstop = 20 pips above entryprice
JumpLong = if price moves 40 pips above entryprice, and JumpLong Stop is set at 30 pips above entryprice at 1.1130
LSVal = 40 pips below entry
CloseLong = 100 pips above entry

So if i buy EUR/USD at 1.1100, and market moves to 1.1120, Breakeven stop is set at entryprice.(1.1100)
If market moves up to jump stop level at 1.1140, Jumplong stop is posted at 1.1130.
If market moves down 40 pips below, LSVal stop is triggered at 1.1060.
If market continues moving up, profit target is hit at 1.1200.

A few issues.
1. However, when I run a backtest on it, it triggers orders sporadically. At times it misses the jumpstop, and eventually goes on to hit the stoploss, even though the jump opportunity came first.
2. I want to use my own code instead of reserved functions (setstoploss, setbreakeven, etc), as I want to add more functionality to my stops. Seems like it this is that is causing the randomness of order triggers. What can i do/change to avoid that?

Apologies if any of this sounds confusing.

if marketposition = 0 then begin

if condition1 and condition2 then Buy ("Open-L1") (Lots) contracts Next bar at BuyLimit Limit; //Buy order .


if marketposition = 1 then begin

LBE = entryprice + (BreakevenVal * TickSize);
JumpLong = entryprice + (Jumpstep * TickSize);

if condition3 then begin
	Sell ("Stop-L1") currentcontracts Contracts next bar at LSVal Stop; //Long Stop
if CurrentBid >= LBE then begin
	Sell ("BE-L1") CurrentContracts Contracts Next bar at Entryprice Stop; //BE Long
if CurrentBid - Entryprice >= (JumpStart * TickSize) then begin
	Sell ("Jump-L1") Currentcontracts contracts next bar at JumpLong Stop;//Jump Long
if condition4 then begin
	Sell ("Close-L1") currentcontracts Contracts next bar at CloseLong Limit;  //Long Target


Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > MultiCharts > Custom breakeven/takeprofit/trailingstop

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Intense frustration moving to breakeven+1 in NinjaTrader strategy DavidBodhi NinjaTrader Programming 5 May 27th, 2015 08:22 PM
stoploss to breakeven to trailing stephenszpak NinjaTrader Programming 13 October 13th, 2014 03:30 PM
Breakeven -(certain ticks) treated as loss rsmann123 NinjaTrader 1 September 29th, 2011 09:30 PM
Runner Breakeven re entry emini_Holy_Grail Psychology and Money Management 6 May 1st, 2010 08:48 AM
BREAKEVEN + ONE TICK rajafx1 NinjaTrader Programming 1 November 8th, 2009 05:37 PM

All times are GMT -4. The time now is 12:31 AM.

Copyright © 2016 by 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 2016-10-28 in 0.06 seconds with 19 queries on phoenix via your IP