Strategy refuses to honor an If statement
Author: DouglasJMartin
Creation Date: 6/25/2014 2:12 AM
profile picture

DouglasJMartin

#1
For some reason I've got a script that refuses to honor the results of an "if" statement, and for the life of me I can't see how to resolve it.

The offending "if" and some related code is:

CODE:
Please log in to see this code.

A small sample of the resultant debug window output is:

SWHC 6/12/2014 12:00:00 AM Par[bar]= 15.8432651848975, PriceAboveCloseToPSAR= True
rsi[491] = 70.1464575210931; EMArsi=66.2451061803635; maxRSI = 80

SWHC 6/13/2014 12:00:00 AM Par[bar]= 16.0156733627098, PriceAboveCloseToPSAR= True
rsi[492] = 62.0179432833513; EMArsi=65.8425192377909; maxRSI = 80

SWHC 6/16/2014 12:00:00 AM Par[bar]= 16.1673925591846, PriceAboveCloseToPSAR= True
rsi[493] = 62.7673580986479; EMArsi=65.5496467483487; maxRSI = 80

SWHC 6/17/2014 12:00:00 AM Par[bar]= 16.3009054520825, PriceAboveCloseToPSAR= True
rsi[494] = 62.2383690578109; EMArsi=65.2342869682975; maxRSI = 80

SWHC 6/18/2014 12:00:00 AM Par[bar]= 16.4183967978326, PriceAboveCloseToPSAR= True
rsi[495] = 65.0899790485878; EMArsi=65.2205433568966; maxRSI = 80

SWHC 6/19/2014 12:00:00 AM Par[bar]= 16.5217891820927, PriceAboveCloseToPSAR= True
rsi[496] = 67.5800558711147; EMArsi=65.4452588344411; maxRSI = 80

SWHC 6/20/2014 12:00:00 AM Par[bar]= 17.28, PriceAboveCloseToPSAR= False
rsi[497] = 40.4975493209254; EMArsi=63.0692864998206; maxRSI = 80


Technically, none of this debug output should exist, as the if should not have yielded a "True". Any ideas?
profile picture

Eugene

#2
Take a careful look at the end of the line:

CODE:
Please log in to see this code.


Do you notice the ending ";" character that should not be there? Your PrintDebug block will be processed on each bar because of that typo.
profile picture

DouglasJMartin

#3
Thanks. Embarrasing. I found it an hour after posting, but then could find the ticket to post an apology.
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).