NexusFi: Find Your Edge


Home Menu

 





Problems with strategy programming


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one crossover with 5 posts (0 thanks)
    2. looks_two bnichols with 2 posts (1 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 kojava with 1 posts (0 thanks)
    1. trending_up 3,276 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 8 posts
    2. attach_file 0 attachments




 
Search this Thread

Problems with strategy programming

  #1 (permalink)
 crossover 
Brussels Belgium
 
Experience: Intermediate
Platform: ninja
Frequency: Every few days
Duration: Minutes
Posts: 140 since Jun 2009
Thanks Given: 396
Thanks Received: 326

After a couple of years i decided to set up a strategy in ninja 7. But i have no expierence in programming and i use the startegy templates, incorporated in the platform. As a start i make it simple, a crossover of two ma's or a crossover in a indicator as macd together with a trailing stop and a target.

After experimenting i found how to do it....

BUT if markets are going a little bit faster i have in a second a few contracts more, what absolutely not the intention is, i have a warning with pop-up off overfill, i get a long and a short contarct at the same time........
Just dont think about it for making profits, even in a sim account.

I dont know how to program and this is the only way for me to try to make something

this is the strategy: 2011-06-28_2053 - wout's library 2011-06-28_2054 - wout's library

2011-06-28_2054 - wout's library 2011-06-28_2055 - wout's library 2011-06-28_2056 - wout's library

and this is the chart: 2011-06-28_2059 - wout's library

and i dd a simple bactest : https://screencast.com/t/tOdFDhKGEbcT
So main problem is how to avoid al these problems of overfill, supplement of contracts and having 2 opposite orders in the SuperDome at the same time?

I appreciated your advise and comment s:sos:

Crossover

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
NexusFi Journal Challenge - May 2024
Feedback and Announcements
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
43 thanks
Just another trading journal: PA, Wyckoff & Trends
30 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
  #3 (permalink)
 
bnichols's Avatar
 bnichols 
Dartmouth NS
 
Experience: Intermediate
Platform: MC, MC.Net, NT, TWS
Broker: IB / IQFeed / Kids
Trading: Forex, stocks
Posts: 637 since Feb 2010
Thanks Given: 64
Thanks Received: 460


To start with, any chance you have Calculate On Bar Close = false?

Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 crossover 
Brussels Belgium
 
Experience: Intermediate
Platform: ninja
Frequency: Every few days
Duration: Minutes
Posts: 140 since Jun 2009
Thanks Given: 396
Thanks Received: 326


bnichols View Post
To start with, any chance you have Calculate On Bar Close = false?

Hi Brichols,

I am really new to strategy. Where do i find that calculate on bar false?

Started this thread Reply With Quote
  #5 (permalink)
 crossover 
Brussels Belgium
 
Experience: Intermediate
Platform: ninja
Frequency: Every few days
Duration: Minutes
Posts: 140 since Jun 2009
Thanks Given: 396
Thanks Received: 326

Who needs contracts? i have 5 and only 1 stop...... 2011-06-28_2145 - wout's library

Started this thread Reply With Quote
  #6 (permalink)
 
kojava's Avatar
 kojava 
Orlando, FL
 
Experience: Advanced
Platform: NinjaTrader, ToS, Sierra Chart, MCDT
Broker: Interactive Brokers
Trading: ES, NQ, 6E, 6A, TF, CL
Posts: 43 since Jan 2011
Thanks Given: 53
Thanks Received: 29

It's in Initialize() function.




crossover View Post
Hi Brichols,

I am really new to strategy. Where do i find that calculate on bar false?


Reply With Quote
  #7 (permalink)
 crossover 
Brussels Belgium
 
Experience: Intermediate
Platform: ninja
Frequency: Every few days
Duration: Minutes
Posts: 140 since Jun 2009
Thanks Given: 396
Thanks Received: 326


kojava View Post
It's in Initialize() function.


Hi Kojava,

I did not compile the startegy so i dont see that. If i compile i am lost......

Started this thread Reply With Quote
  #8 (permalink)
 
bnichols's Avatar
 bnichols 
Dartmouth NS
 
Experience: Intermediate
Platform: MC, MC.Net, NT, TWS
Broker: IB / IQFeed / Kids
Trading: Forex, stocks
Posts: 637 since Feb 2010
Thanks Given: 64
Thanks Received: 460


crossover View Post
Hi Brichols,

I am really new to strategy. Where do i find that calculate on bar false?

As kojava says, if you're able to edit the strategy file (Tools > Edit NinjaScript > Strategy then select your custom strategy) you may find the command in the Initialize section.

Otherwise if your strategy is associated with a chart, say, (or otherwise activated) left-click on the Strategies tab in NinjaTrader, then right-click on the strategy and select "Edit Strategy" in the popup window.

You should see something like the pic below. If set to False, set it to True, click OK and try running the strategy again.


Visit my NexusFi Trade Journal Reply With Quote
  #9 (permalink)
 crossover 
Brussels Belgium
 
Experience: Intermediate
Platform: ninja
Frequency: Every few days
Duration: Minutes
Posts: 140 since Jun 2009
Thanks Given: 396
Thanks Received: 326

hello Bnichols,

Thank you for the explaining with image
Now i got it

as you can see the calculate on bar close is true 2011-06-28_2337 - wout's library

Wouter

Started this thread Reply With Quote




Last Updated on June 28, 2011


© 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