NexusFi: Find Your Edge


Home Menu

 





Multiple limit target orders


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Quick Summary with 1 posts (0 thanks)
    2. looks_two toddma with 1 posts (0 thanks)
    3. looks_3 Pritch with 1 posts (0 thanks)
    4. looks_4 josh with 1 posts (0 thanks)
    1. trending_up 2,841 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Multiple limit target orders

(login for full post details)
  #1 (permalink)
 
toddma's Avatar
 toddma 
vancouver canada
 
Experience: Intermediate
Platform: multicharts, ninjatrader
Trading: forex
Posts: 53 since Jul 2012
Thanks Given: 14
Thanks Received: 6

Does anyone know why setting up limit order exits based off of the entry price as shown below is not working
(note: I am using two separate entries of 100000 units - so the entry prices should be different...)

LT1 and LT2 are "limit target" variables


if marketposition = 1 and currententries = 2 then begin
LT1 = entryprice*(1+.005);
LT2 = entryprice*(1+.006);
sell ("LT1") currentshares/2 shares next bar at LT1 limit;
sell ("LT2") currentshares/2 shares next bar at LT2 limit;
end;


I have tried incorporating the code right after the buy order like so (see below) and that hasn't worked either:


....
buy ( "1S" )100000 shares next bar at market;
LT1 = entryprice*(1+.005);
sell ("LT1") currentshares/2 shares next bar at LT1 limit;
end;

buy ( "2S" )100000 shares next bar at market;
LT2 = entryprice*(1+.005);
sell ("LT2") currentshares/2 shares next bar at LT2 limit;
end;

Any help would be greatly appreciated. Thanks!

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trader Dale [email protected] or Scammer Dale
Trading Reviews and Vendors
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Volume profile TradeStation
EasyLanguage Programming
ISO Equity Curve Indicator
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Tao te Trade: way of the WLD
36 thanks
Deaddogs Stock Trading
27 thanks
GFIs1 1 DAX trade per day journal
25 thanks
Supertradersams Thread Journal on NQ/MNQ
24 thanks
Leaving CFD trading and learning futures
12 thanks

(login for full post details)
  #3 (permalink)
 
josh's Avatar
 josh 
Georgia, US
Legendary Market Wizard
 
Experience: None
Platform: SC
Broker: AMP+CQG
Trading: ES, Nikkei
Posts: 6,193 since Jan 2011
Thanks Given: 6,703
Thanks Received: 18,012


You will probably want to post this in an appropriate forum. What kind of code is it? What trading software? Find the correct subforum and you will get some replies I'm sure.

Reply With Quote
(login for full post details)
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,426 since Apr 2013
Thanks Given: 471
Thanks Received: 1,618

toddma,

what is the result you are getting, if you say it is not working?
One issue with entryprice can be that it doesn't have the value of the current entry at the time you are using it.
Meaning in your second code part, I am pretty sure that entryprice still contains the entry price for the previous problem.
To better help you I would need to see what it does on the chart for example. As not working can mean a wide range from do nothing to do something, but not what is intended etc. (depending on what the person means with do nothing).

Regards,
ABCTG


toddma View Post
Does anyone know why setting up limit order exits based off of the entry price as shown below is not working
(note: I am using two separate entries of 100000 units - so the entry prices should be different...)

LT1 and LT2 are "limit target" variables


if marketposition = 1 and currententries = 2 then begin
LT1 = entryprice*(1+.005);
LT2 = entryprice*(1+.006);
sell ("LT1") currentshares/2 shares next bar at LT1 limit;
sell ("LT2") currentshares/2 shares next bar at LT2 limit;
end;


I have tried incorporating the code right after the buy order like so (see below) and that hasn't worked either:


....
buy ( "1S" )100000 shares next bar at market;
LT1 = entryprice*(1+.005);
sell ("LT1") currentshares/2 shares next bar at LT1 limit;
end;

buy ( "2S" )100000 shares next bar at market;
LT2 = entryprice*(1+.005);
sell ("LT2") currentshares/2 shares next bar at LT2 limit;
end;

Any help would be greatly appreciated. Thanks!


Follow me on Twitter Reply With Quote
(login for full post details)
  #5 (permalink)
Pritch
Denver Colorado
 
Posts: 4 since Aug 2013
Thanks Given: 1
Thanks Received: 0


toddma View Post
Does anyone know why setting up limit order exits based off of the entry price as shown below is not working
(note: I am using two separate entries of 100000 units - so the entry prices should be different...)

LT1 and LT2 are "limit target" variables


if marketposition = 1 and currententries = 2 then begin
LT1 = entryprice*(1+.005);
LT2 = entryprice*(1+.006);
sell ("LT1") currentshares/2 shares next bar at LT1 limit;
sell ("LT2") currentshares/2 shares next bar at LT2 limit;
end;


I have tried incorporating the code right after the buy order like so (see below) and that hasn't worked either:


....
buy ( "1S" )100000 shares next bar at market;
LT1 = entryprice*(1+.005);
sell ("LT1") currentshares/2 shares next bar at LT1 limit;
end;

buy ( "2S" )100000 shares next bar at market;
LT2 = entryprice*(1+.005);
sell ("LT2") currentshares/2 shares next bar at LT2 limit;
end;

Any help would be greatly appreciated. Thanks!

When using entryprice you want to specify which entry: for instance entryprice(0) = current entry... Or entryprice(1) for 1 entry ago... Hope this helps.

Reply With Quote





Last Updated on August 29, 2013


© 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