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,918 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?

  #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?
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
GFIs1 1 DAX trade per day journal
18 thanks
The Program
18 thanks
  #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
  #13 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623


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
  #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
  #15 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

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

Regards,
ABCTG

Follow me on Twitter Reply With Quote
  #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
  #17 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

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
Thanked by:
  #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