NexusFi: Find Your Edge


Home Menu

 





Help with Easy Language Strategy with Renkos


Discussion in MultiCharts

Updated
      Top Posters
    1. looks_one jkepha with 4 posts (0 thanks)
    2. looks_two greenroomhoo with 3 posts (0 thanks)
    3. looks_3 Sinatra Fan with 1 posts (1 thanks)
    4. looks_4 Gillou with 1 posts (0 thanks)
    1. trending_up 5,734 views
    2. thumb_up 4 thanks given
    3. group 6 followers
    1. forum 11 posts
    2. attach_file 1 attachments




 
Search this Thread

Help with Easy Language Strategy with Renkos

  #1 (permalink)
 
greenroomhoo's Avatar
 greenroomhoo 
annapolis USA
 
Experience: Intermediate
Platform: Ninja, MC, Sierra, Amibroker
Broker: PFG (too bad), IB, Fidelity, AMP
Trading: ES, NQ, Equities, Forex, Etc.
Posts: 276 since Jun 2011
Thanks Given: 107
Thanks Received: 235

Im about to blow my head off with frustration on a coding issue i cannot figure out. I have a strat i am running on daily renkos. The entry is not relevant but i am having an issue with my trailing stops in the strategy. The logic i am trying to code is relatively simple.

A trailing stop off the last pivot low that moves up after a new higher pivot low is formed. The initial stop is the higher of the last pivot low or 95% of the entry price. see code excerpt below:

if marketposition = 0 then
begin
if condition7 then buy 100 shares next bar at market;
end;

//Long Stop Language
Condition20 = PivotLowVSBar( 1, low,Leftstrength, rightstrength, rightstrength+1) <> -1 ; // if new pivot low forms this is true
if marketposition = 0 and condition20 then longpivotstop = Low[rightStrength]; // when flat and a new pivot low forms, the intrabarpersist variable longpivotstop is set
//equal to the Low of the bar at the new pivot
if marketposition = 1 and condition20 and Low[rightstrength]>Longpivotstop then LongPivotStop = Low[rightStrength]; // when long and a new pivot forms that is higher than the last
//pivot low, longpivotstop is reset to the new higher low.
if marketposition = 1 then begin
currentlongstop = Entryprice*.95; //sets initial stop to 5% from entryprice
If Longpivotstop > currentlongstop and longpivotstop<last then currentlongstop = longpivotstop;
Sell ( "Pivot LX" ) next bar at currentlongstop stop;
end;

The above code seems to generally work ok but there is something i am missing. See attached screen shot i marked up.

Any ideas with what i am screwing up in my logic? its making me crazy.....

Attached Thumbnails
Click image for larger version

Name:	7-2-2012 8-48-07 PM.png
Views:	390
Size:	43.6 KB
ID:	79938  
Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

Please remember Renko's and backtesting don't go well together. Renko's have false opens, and all backtest results will be false.

Best way to troubleshoot your issue in my opinion would be to print the trailing stop price to a debug window, along with a time stamp, so you can see what is happening.

I assume if you change the dataseries to something less exotic, like a 1-range bar, that it works correctly? If so, likely the issue is the Renko bar itself and the false prices.

You could make the first dataseries a 1-range, and the second dataseries your Renko. MultiCharts only allows execution on the first dataseries. Signals could be generated from the secondary series.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
 
greenroomhoo's Avatar
 greenroomhoo 
annapolis USA
 
Experience: Intermediate
Platform: Ninja, MC, Sierra, Amibroker
Broker: PFG (too bad), IB, Fidelity, AMP
Trading: ES, NQ, Equities, Forex, Etc.
Posts: 276 since Jun 2011
Thanks Given: 107
Thanks Received: 235


thanks mike. ill try that. i understand about the limitations of backtesting and renkos...

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 
greenroomhoo's Avatar
 greenroomhoo 
annapolis USA
 
Experience: Intermediate
Platform: Ninja, MC, Sierra, Amibroker
Broker: PFG (too bad), IB, Fidelity, AMP
Trading: ES, NQ, Equities, Forex, Etc.
Posts: 276 since Jun 2011
Thanks Given: 107
Thanks Received: 235

hey mike - i did what you said and figured out my logic issue. if anyone wants the code for trailing pivots i came up with i can post. many thanks

one quick follow up question - I am struggling with coding renkos as data2 for triggering entries and exits. my issue comes with data1 (regular minute bars) having many more bars than data2 (renkos). when there are no renkos in data2 - i get entries and exits on data1.

Im sure there is some boneheaded function i am missing. I tried using "barstatus <> = -1" but that only fixed some of my incorrect entries on data1.

What am i missing?

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
jkepha
San Antonio, TX
 
Posts: 31 since Apr 2020
Thanks Given: 10
Thanks Received: 6

Hi Greenroomhoo,

I have been having trouble creating the code to make a simple renko strategy in easylanguage. Anyway you could share your code? I'd be happy to help you figure out any problems you may be having if that adds any value. Anything would be appreciated.

Thanks,
Ryan

Reply With Quote
  #6 (permalink)
 Gillou 
Bordeaux, FRANCE
 
Experience: Advanced
Platform: MULTICHARTS
Broker: IB
Trading: Eurex
Posts: 8 since Oct 2010
Thanks Given: 2
Thanks Received: 0

issue in backtest with Renko...


https://www.multicharts.com/discussion/viewtopic.php?t=52327

Reply With Quote
  #7 (permalink)
jkepha
San Antonio, TX
 
Posts: 31 since Apr 2020
Thanks Given: 10
Thanks Received: 6

Ah I see. Thanks. Have you ever come across any code for Renko charts?

Reply With Quote
  #8 (permalink)
 
Sinatra Fan's Avatar
 Sinatra Fan 
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
Posts: 66 since May 2019
Thanks Given: 7
Thanks Received: 9

The biggest problem with Renkos and backtesting is that MC will assume the entry is at open which is pretty much impossible. So I created a BACKTESTING version of my signal to be used ONLY for backtesting, where my signal instructions are the same, but the entries and exits are THIS BAR ON CLOSE... instead of next bar market, limit whatever. This bar on close will give you the closest to real results you will get. I did this and now my live trading results are very similar to my backtesting.

Hope this helps.

Reply With Quote
Thanked by:
  #9 (permalink)
rgrof
Brno, Czech Republic
 
Posts: 1 since Jun 2020
Thanks Given: 0
Thanks Received: 0

Hi,

can anyone help me with easylanguage code - for strategy to backtest in tradestation?

Here it goes - if condition1 is met /for example O>C/ then close/sell trade next day on Open at market

Thanks in advance for your support

Reply With Quote
  #10 (permalink)
jkepha
San Antonio, TX
 
Posts: 31 since Apr 2020
Thanks Given: 10
Thanks Received: 6


Yeah this is pretty simple. Try googling and looking at examples of people's code. I'm not in front of comp.

Open is o[1] for PREV bar

Reply With Quote




Last Updated on March 12, 2021


© 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