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 626 views
    2. thumb_up 1 thanks given
    3. group 8 followers
    1. forum 2 posts
    2. attach_file 1 attachments




 
Search this Thread

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

  #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: 547 since May 2012
Thanks Given: 1,419
Thanks Received: 227

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?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
About a successful futures trader who didnt know anythin …
Psychology and Money Management
Cheap historycal L1 data for stocks
Stocks and ETFs
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
 
  #2 (permalink)
 Trembling Hand 
Melbourne, Land of Oz
 
Experience: Advanced
Platform: Sierra Chart, CQG
Broker: CQG
Trading: HSI
Posts: 246 since Jun 2011
Thanks Given: 28
Thanks Received: 360

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 Twitter Reply With Quote
Thanked by:
  #3 (permalink)
 Trembling Hand 
Melbourne, Land of Oz
 
Experience: Advanced
Platform: Sierra Chart, CQG
Broker: CQG
Trading: HSI
Posts: 246 since Jun 2011
Thanks Given: 28
Thanks Received: 360



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 Twitter Reply With Quote




Last Updated on October 14, 2023


© 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