NexusFi: Find Your Edge


Home Menu

 





Multiple limit target orders


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one josh with 1 posts (0 thanks)
    2. looks_two ABCTG with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 toddma with 1 posts (0 thanks)
    1. trending_up 2,899 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

  #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?
Quantum physics & Trading dynamics
The Elite Circle
Better Renko Gaps
The Elite Circle
What broker to use for trading palladium futures
Commodities
Footprint for strategy Builder
NinjaTrader
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Funded Trader platforms
68 thanks
Spoo-nalysis ES e-mini futures S&P 500
21 thanks
Trading with Intuition
18 thanks
GFIs1 1 DAX trade per day journal
15 thanks
The Trading Pit "Futures VIP" Account Journal
15 thanks
  #3 (permalink)
 
josh's Avatar
 josh 
Georgia, US
Legendary Market Wizard
 
Experience: None
Platform: SC
Broker: Denali+Rithmic
Trading: ES, NQ, YM
Posts: 6,264 since Jan 2011
Thanks Given: 6,803
Thanks Received: 18,313


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
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 484
Thanks Received: 1,629

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
  #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