NexusFi: Find Your Edge


Home Menu

 





Strategy exit based on cumulative gain or loss


Discussion in EasyLanguage Programming

Updated
    1. trending_up 2,127 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Strategy exit based on cumulative gain or loss

  #1 (permalink)
Donovan2580
Port St. Lucie, FL
 
Posts: 36 since Jul 2016
Thanks Given: 22
Thanks Received: 37

I am looking to have my strategy “Quit for the day” once I reach a certain profit target or loss amount.

I am hoping it will take into consideration the daily total of my completed trades, as well as any current trade I am in.

Any ideas on this?? Any help would be greatly appreciated.

I am decent at easy language, but really don't know where to start.

Thanks in advance,

Donovan

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
About a successful futures trader who didnt know anythin …
Psychology and Money Management
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
Better Renko Gaps
The Elite Circle
How to apply profiles
Traders Hideout
 
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629


Donovan2580,

the code in the below link might not exactly do what you have in mind, but should give you a good idea about how you could do it:



Other than that you can likely find other examples here on nexusfi.com using the search function or on the official TS forum.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Donovan2580,

one idea that might work for you would include storing the net profit of your strategy on a date change in a variable and then comparing the current net profit against this variable.
Once the different is greater than your target, set a boolean flag to true and use this flag's value to exit any open positions and also to prevent new entries from being taken. Just keep in mind to set the boolean flag to false on a date change, too - otherwise your strategy wouldn't trade anymore after a profit exit.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #5 (permalink)
Donovan2580
Port St. Lucie, FL
 
Posts: 36 since Jul 2016
Thanks Given: 22
Thanks Received: 37

Just wanted to say thank you... The Boolean is maybe a bit over my head, but it gives me something to look into.

Thanks much for taking the time to reply

Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Donovan2580,

you are welcome. A boolean variable simply means that this variable is of the type bool and holds true or false as values ( BOOL (Reserved Word))

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:




Last Updated on July 27, 2017


© 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