Stop Loss Buy for Entry - futures io
futures io futures trading

Stop Loss Buy for Entry

Discussion in EasyLanguage Programming

    1. trending_up 1,100 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments

Welcome to futures io: the largest futures trading community on the planet, with well over 125,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 Loss Buy for Entry

(login for full post details)
  #1 (permalink)
Delhi India
Posts: 1 since Feb 2014
Thanks: 0 given, 0 received

I am trying to buy 2 pips above the previous candle high when the MACD cross above happens. Code is this

inputs: FastLength( 5 ), SlowLength( 70 ), MACDLength( 100 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ) , var3(0);

var0 = MACD( Close, FastLength, SlowLength ) ;
var1 = XAverage( var0, MACDLength ) ;
var2 = var0 - var1 ;
var3 = High[1]+1.0;

condition1 = CurrentBar > 2 and var2 crosses over 0 ;
if condition1 then
Buy( "MacdLE" ) next bar at var3 stop;

But then when I am seeing the buy value, it is showing at High[1] only and not additional 1.0 point above

Can you please help?


Reply With Quote

Can you help answer these questions
from other members on futures io?
Indicators for pair trading MES and M2K
Platforms and Indicators
ZigZag with Depth and Backstep
EasyLanguage Programming
Help Needed: TOS Options Chain IV & IMPL MOVE Calcul …
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
109 thanks
Battlestations: Show us your trading desks!
108 thanks
Rank your Futures vs Stocks trading priority
55 thanks
Want your NinjaTrader indicator created, free?
27 thanks
Whats this confusion with margins?
21 thanks
(login for full post details)
  #3 (permalink)
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received


your code buys for the next market using the high from one bar ago. Which means at the time your order is sent you are using the high from two bars ago. The code is doing that fine and I didn't see wrong entries at High[1] only here.

To avoid issues I would suggest not to use something like High[1] + 1, but use pips/ticks instead like this:
High[1] + (2 * (MinMove/PriceScale))

Follow me on Twitter Reply With Quote

futures io Trading Community Platforms and Indicators EasyLanguage Programming > Stop Loss Buy for Entry

Last Updated on March 2, 2014

Upcoming Webinars and Events

NinjaTrader Indicator Challenge!


Battlestations! Show us your trading desk - $1,500 in prizes!


Importance of Finding Your Own Way w/Adam Grimes

Elite only

Journal Challenge w/Jigsaw


Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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