No trades generated by strategy
Author: zozzy
Creation Date: 5/7/2010 4:12 PM
profile picture

zozzy

#1
I'm new to C#. I tried to generate a very simple 1 SMA script. I used the Rules Wizard to get started. The Rules were simply to BUY if Price CrossOver SMA and SELL if Price CrossUnder SMA. The Wizard did generate a system that worked, but it had 2 SMAs, one for BUY and 1 for SELL. So...I decided to simplify the code. I concerted the rules for a script and edit the changes, eliminatin 1 of the SMAs. I compiled the modified script without any errors, but when I ran it the Chart showed the Price Close and the SMA, but NO Buy or SELL signals were generated.

I'll attach the code if I can figure out how. I'd appreciate any help you can give me. Thanks.

CODE:
Please log in to see this code.
profile picture

Eugene

#2
Replace
CODE:
Please log in to see this code.

with
CODE:
Please log in to see this code.
profile picture

zozzy

#3
Eugene, Thank you. That worked! But would you explain please how the "!" modifies the "IsLastPositionActive"?
profile picture

Eugene

#4
It's one of the logical operators in C#: "!" means "not".
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).