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 3,365 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #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?
Iran Airspace Collapses 18 Points to 15.5% While Hormuz …
Prediction Markets & Event Contracts
El Clasico Draws $9.2M in Prediction Market Action -- Bi …
Prediction Markets & Event Contracts
Iran Airspace Contract Surges to 33.5% as Project Freedo …
Prediction Markets & Event Contracts
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Hungary Called for Magyar at 97pct, Ending 16-Year Orban …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
197 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
BERN ALGOS algo trading journal
8 thanks
  #3 (permalink)
 
josh's Avatar
 josh 
Georgia, US
 
Experience: None
Platform: SC
Broker: Denali+Teton
Trading: ES, NQ, YM
Posts: 6,331 since Jan 2011
Thanks Given: 6,955
Thanks Received: 18,629


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,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

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


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