NexusFi: Find Your Edge


Home Menu

 





Stop Loss Buy for Entry


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
tahseen
Delhi India
 
Posts: 1 since Feb 2014
Thanks Given: 0
Thanks Received: 0

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?

Thanks

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NinjaTrader indicator for last bar percentages
NinjaTrader
convert to nt8
NinjaTrader
TOS inspired trading simulator
ThinkOrSwim
Time, Futures, Scalping, Treasurys
Treasury Notes and Bonds
Need help updating setting in RSqueeze indicator for Nin …
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Vinny E-Mini & Algobox Review TRADE ROOM
8 thanks
Futures spread trading grains education sources?
6 thanks
Just another trading journal: PA, Wyckoff & Trends
4 thanks
Wheres the videos?
3 thanks
Blue wave trading review
2 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,441 since Apr 2013
Thanks Given: 491
Thanks Received: 1,634


tahseen,

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:
 
Code
High[1] + (2 * (MinMove/PriceScale))
Regards,
ABCTG

Follow me on Twitter Reply With Quote




Last Updated on March 2, 2014


© 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 - Sitemap - Downloads - Top
no new posts