NexusFi: Find Your Edge


Home Menu

 





Strategy: second data series for using correct entry times with renko-bars


Discussion in NinjaTrader

Updated
    1. trending_up 1,553 views
    2. thumb_up 1 thanks given
    3. group 8 followers
    1. forum 2 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
 
Renkotrader's Avatar
 Renkotrader 
Frankfurt, Hessen, Germany
 
Experience: Advanced
Platform: NinjaTrader 8
Broker: APEX & NinjaTrader Brokerage
Trading: 6E, 6J, CL, ES, FDAX, FGBL, GC, HG, NQ, RTY, SI, YM
Posts: 542 since May 2012
Thanks Given: 1,424
Thanks Received: 231

Hello strategy programmers,

I am using a entry period in my strategy.

While working with time bars I am having no problems with the correct entry time span.

If I am changing to renko-bars, then the system is not checking, that an order is to late.
I am using close bars and that will not change.

Here is the text, that I wrote with starting at code line 77:

// Here is the check for the valid entry period.
// Most likely the assignment to the second data series from the 1-minute chart is missing here,
// because by means of Renko probably only the times of the closed bars are used instead of realtime.
// (by the way, the staregy works with closed renkos, i.e. close-bars).
// The question arises whether the time condition has to be included elsewhere.
// However, previous attempts proved unsuccessful.


You will find the ExampleStrategy as attachment.

Thank you for helping me!

Best regards,
Renkotrader


Attached Files
Elite Membership required to download: ExampleEntryTimeZones.cs
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Thanks Mike. Godspeed.
The Elite Circle
Warsh Drops Easing Bias, December Hike Now Above 50% -- …
Prediction Markets & Event Contracts
Datafeed for Atas
Platforms and Indicators
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Afternoon-close session
1 thanks
Franks Trading Journey
1 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
  #2 (permalink)
 Trembling Hand 
Melbourne, Land of Oz
 
Experience: Advanced
Platform: Sierra Chart, CQG
Broker: CQG
Trading: HSI
Posts: 249 since Jun 2011
Thanks Given: 30
Thanks Received: 369

Just use the secondary time series as the input for the if statement. Thats is secondary Times[1][0] instead of primary Times[0][0]

 
Code
(Times[1][0].TimeOfDay >= startTime.TimeOfDay) && (Times[1][0].TimeOfDay <= endTime.TimeOfDay))


Follow me on X Reply With Quote
Thanked by:
  #3 (permalink)
 Trembling Hand 
Melbourne, Land of Oz
 
Experience: Advanced
Platform: Sierra Chart, CQG
Broker: CQG
Trading: HSI
Posts: 249 since Jun 2011
Thanks Given: 30
Thanks Received: 369



Renkotrader View Post
Hello strategy programmers

Actually having a second look at this that if statement does nothing. You should to turn it into a bool variable like this,

 
Code
bool CanTrade = Times[1][0].TimeOfDay >= startTime.TimeOfDay && Times[1][0].TimeOfDay <= endTime.TimeOfDay
Then use that bool in the crossover condition. Something like this.

 
Code
if (CanTrade)
    {
if (CrossAbove(smaFast, smaSlow, 1))
EnterLong();
        else if (CrossBelow(smaFast, smaSlow, 1))
EnterShort();
    }
Of course then you will have to handle the exits after you have a position and CanTrade is =false


Follow me on X Reply With Quote




Last Updated on October 14, 2023


© 2026 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 - Downloads - Top
no new posts