NexusFi: Find Your Edge


Home Menu

 





How to gradually close a position?


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one irriss with 8 posts (1 thanks)
    2. looks_two ABCTG with 6 posts (1 thanks)
    3. looks_3 dimitri with 3 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 8,770 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 17 posts
    2. attach_file 0 attachments




 
Search this Thread

How to gradually close a position?

(login for full post details)
  #11 (permalink)
 dimitri 
Athens - Greece
 
Experience: Intermediate
Platform: Metastock
Posts: 76 since Jul 2010
Thanks Given: 202
Thanks Received: 36

Hi, again ... what i have seen working has 4 levels of partial position close .... and possibility to move for each level ... the stop loss ...
Thanks
Dimitri

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Wicked Renko Bars
Traders Hideout
Searching for CurrentMonthOHL Indicator
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ISO Equity Curve Indicator
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Tao te Trade: way of the WLD
37 thanks
Deaddogs Stock Trading
27 thanks
GFIs1 1 DAX trade per day journal
27 thanks
Supertradersams Thread Journal on NQ/MNQ
24 thanks
Leaving CFD trading and learning futures
11 thanks

(login for full post details)
  #12 (permalink)
 dimitri 
Athens - Greece
 
Experience: Intermediate
Platform: Metastock
Posts: 76 since Jul 2010
Thanks Given: 202
Thanks Received: 36


irriss View Post
Yeah, in MT4 it is possible. You need to play with individual orders and it is very flexible.

Thanks

You can try with them if they can do it for you ... according your specifications ...
just a thinking -- Thanks
Dimitri

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


I am afraid but that won't work with Easylanguage.


irriss View Post
I tried that. The problem that the signal name cannot be dynamic.

I can do like

Sellshort ("sig1") 5 contracts this bar on close
Sellshort ("sig2") 5 contracts this bar on close
Sellshort ("sig3") 5 contracts this bar on close


but I cannot generate signal name from a variable.

In my case it has to be dynamic. I dont know how many exit signal I will need at runtime.


Follow me on Twitter Reply With Quote
(login for full post details)
  #14 (permalink)
irriss
Singapore
 
Posts: 8 since Dec 2013
Thanks Given: 1
Thanks Received: 1

Actually I found very strange thing.

If you execute my example.

 
Code
                            
vars:   i(0), 

        
p(0);

if(
i=0then
begin
    buy 15 contracts this bar on close
;
    
CurrentAsk;
    
i+0.1;
end
else
begin
    
if(CurrentAsk>p-ithen
    begin
        sell 5 contracts this bar on close
;
        
i+0.1;
    
end;
end 
It will close the position partially and some part of the position remains open. (this is correct)





However, if you add keyword total it will do exactly as I want - perform multiple exit.

sell 5 contracts total this bar on close;

But, at the end there is an open position! Could you run it on your platform and confirm whether it is bug in OEC or unclear logic of EL?




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

In Multicharts your code with total added to the exit only exits 5 contracts once.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
(login for full post details)
  #16 (permalink)
irriss
Singapore
 
Posts: 8 since Dec 2013
Thanks Given: 1
Thanks Received: 1

Thanks, ABCTG!

So there is no difference with or without total keyword?

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

Yes, at least in MC there is none.


irriss View Post
Thanks, ABCTG!

So there is no difference with or without total keyword?


Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
(login for full post details)
  #18 (permalink)
irriss
Singapore
 
Posts: 8 since Dec 2013
Thanks Given: 1
Thanks Received: 1

Yes, I checked myself also in MC.

It is a bug (or unexpected behavior) in OEC.

Thanks for your great help, ABCTG!

Reply With Quote





Last Updated on December 5, 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