NexusFi: Find Your Edge


Home Menu

 





Programming third profitable close


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
edgeseek
Riyadh, Saudi Arabia
 
Posts: 5 since Feb 2017
Thanks Given: 0
Thanks Received: 0

Hey all,

I'm trying to program a strategy to exit on the third profitable close.

But I have had success only to program it to exit on one profitable close only.

Would appreciate the help if any..
 
Code
If marketposition = 1 and  close > entryprice Then
	Sell 1 contract this bar close;


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
No book, only a stair: journaling fills where price move …
Cryptocurrency
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
Datafeed for Atas
Platforms and Indicators
My Rant with AMP Futures
Trading Reviews and Vendors
Trump Media to sell instant access to market-moving soci …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
Johnnys Journal
2 thanks
TopStep Trader disappointment
2 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643


edgeseek,

how exactly do you define the "third profitable close", can you provide an example?

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:
  #4 (permalink)
edgeseek
Riyadh, Saudi Arabia
 
Posts: 5 since Feb 2017
Thanks Given: 0
Thanks Received: 0

I would define it as third close larger than entry price:

Close > Entry price .....first profitable close ( do nothing)

Close > Entry Price .... second profitable close ( do nothing)

Close > Entry Price ..... third profitable close (Take as third profitable close)

I hope this explains it clearly


Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

edgeseek,

do you mean three bars have to Close above the entry price while you are in a trade?
If that is the case you have to program your own counter. Use a variable and add +1 to it when your condition is met.
Then when the counter variable is >= 3 trigger your exit.

Finally you only have to reset it after the trade, at the beginning of a new trade or when the Close is below your entry price - depending on what you have in mind of course.

Regards,

ABCTG


Follow me on X Reply With Quote
  #6 (permalink)
edgeseek
Riyadh, Saudi Arabia
 
Posts: 5 since Feb 2017
Thanks Given: 0
Thanks Received: 0

That is exactly what I was thinking. If you can please explain how to setup the variable and the counter variable I have googled a lot and couldn't find anything specific related to this.


Reply With Quote
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

edgeseek,

I would suggest to take a look at the EL Essentials PDF, this will cover a lot of the required basics.

Post the code you did so far based on the possible solution I wrote and I will gladly look it and steer you in the right direction.

Regards,

ABCTG


Follow me on X Reply With Quote




Last Updated on February 20, 2017


© 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