Welcome to NexusFi: the best trading community on the planet, with over 200,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- discounts are available after registering.
-- The NexusFi team
(If you already have an account, login at the top of the page)
Hello, I'm in the process of learning EasyLanguage, and am working through a bit of a learning curve. I have a simple RSI strategy that I use and would like to add two more parameters, one to the entries and the other to the exits.
My current entry point is simply on the cross above the overbought zone. My positions are very small and I have multiple positions open at the same time. The problem is that price can go in and out of that zone multiple times within a very short timeframe. Is there a way to limit the amount of entries based on the number of bars that have passed since the last entry? For instance, don't enter if the last entry was within 20 bars?
Regarding the exit parameters, was wondering if I could base the stop and the target on a multiplier of the ATR?
Hopefully this makes sense, let me know if you need further clarification. I've placed my current code below, probably a bit of a mess:
Thanks in advance!
Jacob
{ Search Tag: WA-RSI LE }
inputs:
Price( Close ) [DisplayName = "Price", ToolTip =
"Enter an EasyLanguage expression to use in the RSI calculations."],
Length( 14 ) [DisplayName = "Length", ToolTip =
"Enter the number of bars used in the RSI calculation."],
OverBought( 70 ) [DisplayName = "OverBought", ToolTip =
"Enter the level of RSI at which you consider the market to be overbought (too high)."];
variables:
RSIValue( 0 );
RSIValue = RSI( Price, Length );
[IntrabarOrderGeneration = false]
inputs:
PositionBasis( false ) [DisplayName = "PositionBasis", ToolTip =
"Enter true if currency amounts (profit targets, stops, etc.) are for the entire position; enter false if currency amounts are per share or per contract."],
Amount( 1 ) [DisplayName = "Amount", ToolTip =
"Enter the amount of the profit target (Total position amount if PositionBasis is true; amount per share if PositionBasis is set to false)."];
if PositionBasis then
SetStopPosition
else
SetStopShare;
SetProfitTarget( Amount );
{ CB > 1 check used to avoid spurious cross confirmation at CB = 1 }
if CurrentBar > 1 and RSIValue crosses over OverBought then
Buy ( !( "RsiLE" ) ) next bar at market;
You can create a variable to store the values of the ATR when you enter your position. I'm attaching part of a code I have written in the past that uses the concept to set an SL and TP based on a SuperTrend. I hope this can guide you in the right direction. Let me know if this is unclear.