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.
Size:
Color:
Replace
CODE:
Please log in to see this code.
with
CODE:
Please log in to see this code.
Size:
Color:
Eugene, Thank you. That worked! But would you explain please how the "!" modifies the "IsLastPositionActive"?
Size:
Color:
It's one of the logical operators in C#: "!" means "not".
Size:
Color: