Retrace before reentry? - futures io
futures io futures trading



Retrace before reentry?


Discussion in EasyLanguage Programming

Updated by jrh059
      Top Posters
    1. looks_one jrh059 with 6 posts (0 thanks)
    2. looks_two SMCJB with 4 posts (2 thanks)
    3. looks_3 ABCTG with 4 posts (3 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 1,149 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 14 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Thread Tools Search this Thread
 

Retrace before reentry?

  #1 (permalink)
Denver CO
 
 
Posts: 6 since Jul 2014
Thanks: 3 given, 0 received

Retrace before reentry?

I've been stuck on this problem for awhile and wondering if there is a simple solution.

I am using SetStopLoss to exit a position (say 20 ticks) but only want to re-enter a position if price has gone against the original entry price by at least 40 ticks at some point between my SetStopLoss exit and the next entry.

any suggestions?

Reply With Quote

Can you help answer these questions
from other members on futures io?
Convert NinjaTrader NT7 indicator to Tradestation EasyLanguage and RADARSCREEN
Platforms and Indicators
Issue meeting order entry conditions
Elite Automated NinjaTrader Trading
Last 5 minutes Label
ThinkOrSwim
Moving average with Lag reduction
NinjaTrader
Linux?
ThinkOrSwim
 
Best Threads (Most Thanked)
in the last 7 days on futures io
What is your single biggest weakness?
95 thanks
Spoo-nalysis ES e-mini futures S&P 500
89 thanks
Is Volume Profile worth learning or is it an outdated concept?
59 thanks
Is Amp at risk of going under?
52 thanks
Is Orderflow An Outdated Concept?
30 thanks
 
  #3 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,178 since Apr 2013
Thanks: 384 given, 1,411 received


jrh059,

we could try to point you in the right direction when you post the code you are stuck with.
One idea would be using a flag that you use to only allow another entry in case the market moved X points higher than your exit price.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
 
  #4 (permalink)
Legendary Market Wizard
Houston, TX
 
Experience: Advanced
Platform: XTrader and Cloud TT
Broker: Advantage Futures
Trading: Energy
 
Posts: 3,454 since Dec 2013
Thanks: 2,758 given, 6,491 received

Maybe a noob question @ABCTG but how do you know what your exit price was?

Reply With Quote
 
  #5 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,178 since Apr 2013
Thanks: 384 given, 1,411 received

@SMCJB,

you can access the exit price via the reserved word ExitPrice. This will work fine, unless you scale in and out of positions. In this case you can access the respective prices using the StrategyHost class.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
 
  #6 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,178 since Apr 2013
Thanks: 384 given, 1,411 received

The same way the entry price is accessible via the reserved word EntryPrice. @jrh059 you can use this to only allow a new entry when you are flat and if the current price is X ticks above the last entry price.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
 
  #7 (permalink)
Denver CO
 
 
Posts: 6 since Jul 2014
Thanks: 3 given, 0 received

Thank you for your response.

To clear up any confusion, once I am stopped out of a long position, I want price to go LOWER than where I was stopped out before taking another entry.

The code I am currently trying is as follows:

Var:
bool LongFalseStop(False);

If ExitPrice(1)<=EntryPrice(1)-.20 and Lowest(Low,BarsSinceExit(1))<=EntryPrice(1)-.40 then
LongFalseStop=True;

If LongFalseStop=True then Buy

Using the print function, I can tell that this should work but the problem is that I can't figure out how to initiate the first entry without setting the LongFalseStop Variable to TRUE in the beginning, at which point the code doesnt work.

Reply With Quote
 
  #8 (permalink)
Legendary Market Wizard
Houston, TX
 
Experience: Advanced
Platform: XTrader and Cloud TT
Broker: Advantage Futures
Trading: Energy
 
Posts: 3,454 since Dec 2013
Thanks: 2,758 given, 6,491 received

entryprice is zero until you have your first trade

 
Code
Var:
   bool LongFalseStop(False);

if entryprice = 0 then
   first trade condition
else begin
   If ExitPrice(1)<=EntryPrice(1)-.20 and Lowest(Low,BarsSinceExit(1))<=EntryPrice(1)-.40 then LongFalseStop=True;
   If LongFalseStop=True then Buy
end;

Reply With Quote
The following user says Thank You to SMCJB for this post:
 
  #9 (permalink)
Denver CO
 
 
Posts: 6 since Jul 2014
Thanks: 3 given, 0 received

Thank you! That did work. However, now it seems that the LongFalseStop stays True for every bar following the first bar that it is True, making it ineffective because there is never a False condition. Is there a way to make it reset or reevaluate each bar?

Reply With Quote
 
  #10 (permalink)
Legendary Market Wizard
Houston, TX
 
Experience: Advanced
Platform: XTrader and Cloud TT
Broker: Advantage Futures
Trading: Energy
 
Posts: 3,454 since Dec 2013
Thanks: 2,758 given, 6,491 received


Just set it to false on every bar or my preference is to

 
Code
If ( (ExitPrice(1) <= EntryPrice(1) - 0.20) and (Lowest(Low, BarsSinceExit(1)) <= EntryPrice(1) - 0.40) ) then
   LongFalseStop = True else LongFalseStop = False;

Reply With Quote



futures io Trading Community Platforms and Indicators EasyLanguage Programming > Retrace before reentry?




Upcoming Webinars and Events
 

Free BloodHound Licenses to everyone!

June
 

Every journal equals ten meals for the hungry

June
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts