NexusFi: Find Your Edge


Home Menu

 





Programming third profitable close


Discussion in EasyLanguage Programming

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




 
Search this Thread

Programming third profitable close

  #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?
Better Renko Gaps
The Elite Circle
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
 
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629


edgeseek,

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

Regards,

ABCTG

Follow me on Twitter 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,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

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 Twitter 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,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

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 Twitter Reply With Quote




Last Updated on February 20, 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