NexusFi: Find Your Edge


Home Menu

 





Problem coding a strategy with LinRegSlopeSFX


Discussion in NinjaTrader

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




 
Search this Thread

Problem coding a strategy with LinRegSlopeSFX

  #1 (permalink)
 
stoicbuddha's Avatar
 stoicbuddha 
Seattle, WA
 
Experience: Intermediate
Platform: NinjaTrader 8
Broker: AMP/CQG
Trading: Indices
Frequency: Every few days
Duration: Minutes
Posts: 96 since Feb 2012
Thanks Given: 1,054
Thanks Received: 96

I'm writing code that sends an alert when the LinRegSlopeSFX indicator crosses its "zero" line, but I've had a frustrating time coding the CrossAbove/Below if statement. Here's what I have so far:

if ((CrossAbove(LinRegSlopeSFX(False, 16, 1).SlopeSFX, 0, 1) || CrossBelow(LinRegSlopeSFX(False, 16, 1).SlopeSFX, 0, 1)) && (!Historical))
{}

when i try compiling it, it tells me "the name False does not exist in the current context". I'm sure there's something simple I'm missing. I figured I don't have to add the Indicator in the code as the indicator provides SlopeSFX in a public DataSeries. Can someone help here?

Thanks!

Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
About a successful futures trader who didnt know anythin …
Psychology and Money Management
Better Renko Gaps
The Elite Circle
 
  #3 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,612 since Aug 2009
Thanks Given: 11,343
Thanks Received: 2,747



happyrenko View Post
I'm writing code that sends an alert when the LinRegSlopeSFX indicator crosses its "zero" line, but I've had a frustrating time coding the CrossAbove/Below if statement. Here's what I have so far:

if ((CrossAbove(LinRegSlopeSFX(False, 16, 1).SlopeSFX, 0, 1) || CrossBelow(LinRegSlopeSFX(False, 16, 1).SlopeSFX, 0, 1)) && (!Historical))
{}

when i try compiling it, it tells me "the name False does not exist in the current context". I'm sure there's something simple I'm missing. I figured I don't have to add the Indicator in the code as the indicator provides SlopeSFX in a public DataSeries. Can someone help here?

Thanks!

False should not be capitalized (i.e. false)
p.s I did not put this into NT to see if it has the correct parameters but just by looking, the misspelling of False will give that error.

Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
 
stoicbuddha's Avatar
 stoicbuddha 
Seattle, WA
 
Experience: Intermediate
Platform: NinjaTrader 8
Broker: AMP/CQG
Trading: Indices
Frequency: Every few days
Duration: Minutes
Posts: 96 since Feb 2012
Thanks Given: 1,054
Thanks Received: 96


DavidHP View Post
False should not be capitalized (i.e. false)
p.s I did not put this into NT to see if it has the correct parameters but just by looking, the misspelling of False will give that error.

That did it, I can't believe it was that simple!

Thanks!

Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on August 5, 2016


© 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