Avoiding re-entries - futures io
futures io futures trading



Avoiding re-entries


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one kevinkdog with 6 posts (1 thanks)
    2. looks_two Bodil with 5 posts (0 thanks)
    3. looks_3 StratOpt with 2 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 2,960 views
    2. thumb_up 3 thanks given
    3. group 3 followers
    1. forum 14 posts
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,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)

 
Search this Thread
 

Avoiding re-entries

(login for full post details)
  #1 (permalink)
Oslo, Norway
 
Experience: Advanced
Platform: TradeStation / MultiCharts
Trading: Forex / Futures
 
Bodil's Avatar
 
Posts: 26 since Aug 2012
Thanks: 5 given, 0 received

Hi everybody.

I have a strategy where the entry logic is RSI > OverBought for long and RSI < OverSold. If I use "crosses over" and "crosses under" respectively, no trades are generated for some reason. If the price reaches my profit target or stoploss level and the condition is still true, the system takes a new entry. How can I avoid these re-entries? What I want to achieve is only one entry per new signal.

Thank you very much in advance!

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
Can the Magnet Tool Affect Chart Orders In Overcharts Ha …
Platforms and Indicators
MACD line not plotting after change of plot order
NinjaTrader
Tools for backtesting?
Platforms and Indicators
SimplerOptions
Trading Reviews and Vendors
 
 
(login for full post details)
  #3 (permalink)
 
 
Posts: 2,979 since Jul 2012
Thanks: 1,576 given, 5,902 received



Bodil View Post
Hi everybody.

I have a strategy where the entry logic is RSI > OverBought for long and RSI < OverSold. If I use "crosses over" and "crosses under" respectively, no trades are generated for some reason. If the price reaches my profit target or stoploss level and the condition is still true, the system takes a new entry. How can I avoid these re-entries? What I want to achieve is only one entry per new signal.

Thank you very much in advance!

Crosses over and Crosses under should work. I bet there is something else hindering signals. Please post non-proprietary portions of your code, along with a chart showing what is wrong. Or, print out values of RSI, Oversold and Undersold after each bar, and see if the data shows cross over and cross under.

Follow me on Twitter Reply With Quote
The following user says Thank You to kevinkdog for this post:
 
(login for full post details)
  #4 (permalink)
Oslo, Norway
 
Experience: Advanced
Platform: TradeStation / MultiCharts
Trading: Forex / Futures
 
Bodil's Avatar
 
Posts: 26 since Aug 2012
Thanks: 5 given, 0 received

The code is very basic:

inputs:
Price( Close ),
Length( 14 ),
OverSold( 40 ),
OverBought( 60 );

variables:
RSI_Mod( 0 ),
Signal(0) ;

RSI_Mod = RSI( (c+h+l)/3, Length );


//Long Entry
If RSI_Mod crosses over OverBought
Then Buy ("LE-RSI") next bar at open limit;


//Short Entry
If RSI_Mod crosses under OverSold
Then SellShort ("SE-RSI") next bar at open limit;

Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
 
 
Posts: 2,979 since Jul 2012
Thanks: 1,576 given, 5,902 received


Bodil View Post
The code is very basic:

inputs:
Price( Close ),
Length( 14 ),
OverSold( 40 ),
OverBought( 60 );

variables:
RSI_Mod( 0 ),
Signal(0) ;

RSI_Mod = RSI( (c+h+l)/3, Length );


//Long Entry
If RSI_Mod crosses over OverBought
Then Buy ("LE-RSI") next bar at open limit;


//Short Entry
If RSI_Mod crosses under OverSold
Then SellShort ("SE-RSI") next bar at open limit;


Code looks good. Please show example of this not working as you expect.

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #6 (permalink)
Oslo, Norway
 
Experience: Advanced
Platform: TradeStation / MultiCharts
Trading: Forex / Futures
 
Bodil's Avatar
 
Posts: 26 since Aug 2012
Thanks: 5 given, 0 received

If you look at the attached example, I would have expected the system to go long somewhere between 10.30 and 11.00. It does not.

Attached Thumbnails
Click image for larger version

Name:	audjpy ex.bmp
Views:	65
Size:	1.60 MB
ID:	130843  
Started this thread Reply With Quote
 
(login for full post details)
  #7 (permalink)
 
 
Posts: 2,979 since Jul 2012
Thanks: 1,576 given, 5,902 received

Here is your problem:

Then Buy ("LE-RSI") next bar at open limit;



This says to place a limit order to buy at the open of the current signal bar. So, if the price of the next bar never goes below the open of the signal bar, no fill will occur.

Maybe you want instead:

Then Buy ("LE-RSI") next bar at market;

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #8 (permalink)
Oslo, Norway
 
Experience: Advanced
Platform: TradeStation / MultiCharts
Trading: Forex / Futures
 
Bodil's Avatar
 
Posts: 26 since Aug 2012
Thanks: 5 given, 0 received

OK. Thanks!

But is there a way to use limit orders instead of market orders? The spread is so big it eats the profits before you even enters the trade......

Also, if I should use the "larger than" respectively "smaller than" instead of crosses over/under: Is there a way I can avoid re-entries in the same direction on the same entry signal?

Started this thread Reply With Quote
 
(login for full post details)
  #9 (permalink)
 
 
Posts: 2,979 since Jul 2012
Thanks: 1,576 given, 5,902 received


Bodil View Post
OK. Thanks!

But is there a way to use limit orders instead of market orders? The spread is so big it eats the profits before you even enters the trade......

Also, if I should use the "larger than" respectively "smaller than" instead of crosses over/under: Is there a way I can avoid re-entries in the same direction on the same entry signal?


1. If the spread is so big, maybe you should not be trading it. Big spreads grind you down, even if you only have then on stop orders.

2. To take it a step further, ALL your test results with limit or stop orders are invalid. It is because you are only using bid data to evaluate your strategy. Quick example: Assume the bid hits your buy limit, but the ask doesn't. Your strategy will show a fill, but not the real world. Think about this for awhile - it is a critical point. SUPER critical.

3. Crosses above and under should work. For a cross above to be triggered, it has to cross below the same line. The logic will need to be different if you want to ensure long - short - long - short.

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #10 (permalink)
 
 
Posts: 2,979 since Jul 2012
Thanks: 1,576 given, 5,902 received


Because of the reason I describe in point 2 above, when I do Forex development, I ONLY use market orders. No stop orders, no limit orders.

Of course, I work in Tradestation. Multicharts has an option to test with both bid and ask data, so limits and stops are probably OK there. I am not sure of Ninja.

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #11 (permalink)
Colorado
 
Experience: Advanced
Platform: MultiCharts
Broker: IB & Iqfeed
Trading: ES , CL
 
sptrader's Avatar
 
Posts: 543 since Apr 2010
Thanks: 1,094 given, 696 received


Bodil View Post
OK. Thanks!

But is there a way to use limit orders instead of market orders? The spread is so big it eats the profits before you even enters the trade......

Also, if I should use the "larger than" respectively "smaller than" instead of crosses over/under: Is there a way I can avoid re-entries in the same direction on the same entry signal?

*********************************************************************
You could still use a limit order but give it a little more room (through testing to find best amount) by saying something like -
Then Buy ("LE-RSI") next bar at open + 2 points limit;

Reply With Quote
The following user says Thank You to sptrader for this post:
 
(login for full post details)
  #12 (permalink)
Oslo, Norway
 
Experience: Advanced
Platform: TradeStation / MultiCharts
Trading: Forex / Futures
 
Bodil's Avatar
 
Posts: 26 since Aug 2012
Thanks: 5 given, 0 received

Thank you for all your great tips. I will surely go though all this and think about it! I really appreciate this

Started this thread Reply With Quote
 
(login for full post details)
  #13 (permalink)
AR Kansas
 
 
Posts: 13 since Dec 2013
Thanks: 0 given, 7 received

EasyLanguage will also allow you to define the entry as

SellShort ("ShortLimit") next bar open next bar + 2 limit ;

Reply With Quote
 
(login for full post details)
  #14 (permalink)
 
 
Posts: 2,979 since Jul 2012
Thanks: 1,576 given, 5,902 received


StratOpt View Post
EasyLanguage will also allow you to define the entry as

SellShort ("ShortLimit") next bar open next bar + 2 limit ;


Welcome to futures.io (formerly BMT) Nemo!

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #15 (permalink)
AR Kansas
 
 
Posts: 13 since Dec 2013
Thanks: 0 given, 7 received

Thanks KDog. I am liking what I am seeing here thus far. It will take a bit of time to learn my way around. Good to see that you are doing well. Sorry to the OP for diverting off topic a bit here.

Reply With Quote
The following user says Thank You to StratOpt for this post:


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Avoiding re-entries


Last Updated on December 18, 2013


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 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