NexusFi: Find Your Edge


Home Menu

 





BarsSinceEntryExecution isn't working.


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one alecsaccount with 29 posts (0 thanks)
    2. looks_two rleplae with 20 posts (19 thanks)
    3. looks_3 gisot with 3 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 15,877 views
    2. thumb_up 19 thanks given
    3. group 3 followers
    1. forum 52 posts
    2. attach_file 11 attachments




 
Search this Thread

BarsSinceEntryExecution isn't working.

  #41 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


alecsaccount View Post
You mean only buy if current market position = flat? Because if I said only buy if no positions = flat, nothing would happen.

Anyway, that's the first thing I tried. Nothing. the problem must be that as soon as the fast SMA goes below the long one, it exits the position, and then it's flat again for a moment and buys again.

I'm not going to make it calculate on bar close.. No, that would make whatever I'm trying to do way less accurate. The strategy I'm building is actually a lot larger and more complex than this, I just didn't feel like the rest was relevant, so I didn't post it.

So how do I add a flag? Is that something I can do on the strategy builder, or would I have to open the chart and put a flag at each problem area..?

A flag is a variable, that you give a certain value, to avoid multiple entries, or re-entry on the same bar.
I never work with strategy builder, but i guess, especially if you are building something more complex you
will have to change code manually. Even more complex things i make them completely outside of NT.

Good luck in your effort

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
Exit Strategy
NinjaTrader
How to apply profiles
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
33 thanks
Just another trading journal: PA, Wyckoff & Trends
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #42 (permalink)
 alecsaccount 
San Diego, California
 
Experience: Beginner
Platform: NinjaTrader 8
Trading: Emini ES, EUR/USD
Posts: 65 since Dec 2016
Thanks Given: 229
Thanks Received: 13


rleplae View Post
A flag is a variable, that you give a certain value, to avoid multiple entries, or re-entry on the same bar.
I never work with strategy builder, but i guess, especially if you are building something more complex you
will have to change code manually. Even more complex things i make them completely outside of NT.

Good luck in your effort

Okay, but how do I make a flag? I kind of need to know this.

Assume I wasn't making something more complex.. Just tell me how to do it for the example I gave you.. Please.

Started this thread Reply With Quote
  #43 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863



alecsaccount View Post
Okay, but how do I make a flag? I kind of need to know this.

it could be various ways

1. boolean flag
when you put an order, you put the boolean to true
when the order is executed or cancelled you put it to false
this would solve multiple entries

2. last order bar
memorize the bar that triggered the last order, if the next
trigger is the same bar, simply void it and wait for at least
a different bar, this would solve repeat entries in the same
bar

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #44 (permalink)
 alecsaccount 
San Diego, California
 
Experience: Beginner
Platform: NinjaTrader 8
Trading: Emini ES, EUR/USD
Posts: 65 since Dec 2016
Thanks Given: 229
Thanks Received: 13

thanks so much for your help. this is pretty alien to me still, but I should be able to figure it out from here! (:

Why you would spend your time helping me is beyond me, but I am very grateful that you did.

Sent using the NexusFi mobile app

Started this thread Reply With Quote
  #45 (permalink)
 alecsaccount 
San Diego, California
 
Experience: Beginner
Platform: NinjaTrader 8
Trading: Emini ES, EUR/USD
Posts: 65 since Dec 2016
Thanks Given: 229
Thanks Received: 13


rleplae View Post
it could be various ways

1. boolean flag
when you put an order, you put the boolean to true
when the order is executed or cancelled you put it to false
this would solve multiple entries

2. last order bar
memorize the bar that triggered the last order, if the next
trigger is the same bar, simply void it and wait for at least
a different bar, this would solve repeat entries in the same
bar

okay wait.. when you say "you put the boolean to true," how do I do that? I don't see "boolean" in the list of indicators. is this a piece of code I have to add the script, or an indicator I have to download off the internet..?

one again, I'm sorry for taking up your time. I know, I'm such a noob..

Sent using the NexusFi mobile app

Started this thread Reply With Quote
  #46 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


alecsaccount View Post
thanks so much for your help. this is pretty alien to me still, but I should be able to figure it out from here! (:

Why you would spend your time helping me is beyond me, but I am very grateful that you did.

Sent using the NexusFi mobile app

A community can only work if once in a while you give back.

I learned a lot on futures.io and I found a few very instructive people, who helped me get to the level where i am
if they would not have "helped" me, i would not be where i am.

Good luck in your effort.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #47 (permalink)
 alecsaccount 
San Diego, California
 
Experience: Beginner
Platform: NinjaTrader 8
Trading: Emini ES, EUR/USD
Posts: 65 since Dec 2016
Thanks Given: 229
Thanks Received: 13

okay, so just in case anyone who can help me is still here- I figured if the problem was that it was entering and exiting repeatedly as the bar ticks above and below the SMA.. then I could fix it by adding a condition to my entries;

if bars since exit execution > 15

and that would prevent it from entering again if it was ranging above and below the SMA.. but it didn't work.

WHY DIDN'T IT WORK???

Edit: I just realized it still plots entries and exits on the chart when I backtest, but the Summary is blank, and even though I have all the conditions set to 'plot on chart,' none of them are plotting on the chart. What is that about? Is this actually just a glitch?

Started this thread Reply With Quote
  #48 (permalink)
 
gisot's Avatar
 gisot 
Milan, Italy
 
Experience: Beginner
Platform: NinjaTrader, TWS
Trading: ES, Stocks
Frequency: Every few days
Duration: Minutes
Posts: 278 since Jan 2012
Thanks Given: 385
Thanks Received: 178


alecsaccount View Post
Fuck, I knew that. Did I mention it's very, very late? Hold on.

@rleplae
@alecsaccount

Hello Gentlemen,
I was wondering if then you were able to end up with something useful regarding this issue of this interesting thread "BarsSinceEntryExecution isn't working".

I am very interested on this subject, because I tried to solve the very same issue. I also asked for NT support help and I exchanged several emails (sometime I could not really understand what they were saying) with them, but I could not end up with anything useful.

Then after a couple of weeks I noticed on this forum this great new thread of yours, but ... I do not see a conclusion. Did you perhaps end up with a practical solution to the issue of the subject.
If so please, kindly, could you let us all know?
Thank you very much for your precious time.
GT

cc. @ninja

Reply With Quote
  #49 (permalink)
 alecsaccount 
San Diego, California
 
Experience: Beginner
Platform: NinjaTrader 8
Trading: Emini ES, EUR/USD
Posts: 65 since Dec 2016
Thanks Given: 229
Thanks Received: 13


guidoisot View Post
@rleplae
@alecsaccount

Hello Gentlemen,
I was wondering if then you were able to end up with something useful regarding this issue of this interesting thread "BarsSinceEntryExecution isn't working".

I am very interested on this subject, because I tried to solve the very same issue. I also asked for NT support help and I exchanged several emails (sometime I could not really understand what they were saying) with them, but I could not end up with anything useful.

Then after a couple of weeks I noticed on this forum this great new thread of yours, but ... I do not see a conclusion. Did you perhaps end up with a practical solution to the issue of the subject.
If so please, kindly, could you let us all know?
Thank you very much for your precious time.
GT

cc. @ninja

I never did end up figuring it out.. Did you, by chance?

Started this thread Reply With Quote
  #50 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863



alecsaccount View Post
Again, I'm not writing this with the ninjascript editor; I'm using the strategy builder because I have no experience coding whatsoever. So what you just wrote means very little to me.

I don't understand. I've only been running one time frame, one instrument, one data series, as far as I know.

Backtest type: Standard

Strategy: Long

Instrument: ES 12-16

Price based on: Last

Type: Minute

Value: 15

Start date: 01/01/2016

End date: 12/31/2016

Trading hours: <Use instrument settings>

Break at EOD: true

Include commission: false

Maximum bars lookback: Infinite

Bars required to trade: 20

Entries per direction: 1

Entry handling: All entries

Exit on session close: false

Set order quantity: Strategy

Time in force: GTC


I am afraid that without minimal coding (= edit source file and a Print statement),
you will not be able to solve this...

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on December 21, 2017


© 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