NexusFi: Find Your Edge


Home Menu

 





Strategy Condition Logic >> my wetware


Discussion in NinjaTrader

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




 
Search this Thread

Strategy Condition Logic >> my wetware

  #1 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184

Greets!

I am trying to add this type of condition to the condition 'if' statement of the strategy, and while it does compile, there are no results generated when running a backtest:

SwingGap.SwingHigh [0] - SwingGap.SwingLow [0] > 14

In other words I dont want to take a trade if the range between the current swing high and low is less that a predetermined amount. Sorry, I am typing from a computer where the strategy is not installed: I can post the rest of the code later if it is helpful.

I have tried private boll statements but it is not accepted that way either. I must be missing a step that is obvious to some ... not to me though.

Can someone please help me out?

Thanks,
Jon

Started this thread Reply With Quote
The following user says Thank You to Trader.Jon for this post:

Can you help answer these questions
from other members on NexusFi?
Request for MACD with option to use different MAs for fa …
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
55 thanks
NexusFi site changelog and issues/problem reporting
48 thanks
What percentage per day is possible? [Poll]
31 thanks
GFIs1 1 DAX trade per day journal
29 thanks

  #3 (permalink)
 zeller4 
Orlando Florida
 
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 477 since Jun 2009
Thanks Given: 1,416
Thanks Received: 404


It might take more parentheses or creating a double value of the High-Low

try:

 
Code
if ((SwingGap.SwingHigh [0] - SwingGap.SwingLow [0]) > 14)
{
do whatever you want here
}
or

 
Code
"variables"
private double diff = 0;
 
"onbarupdate"
diff = SwingGap.SwingHigh [0] - SwingGap.SwingLow [0];
if (diff > 14)
{
 
}
not tested...good luck
kz

Reply With Quote
The following user says Thank You to zeller4 for this post:





Last Updated on May 24, 2010


© 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