I've been trying to get this to work all day and have managed to produce all kinds of various errors, maybe this would be a good time to ask for some help.
My goal is to make is so the user can specify long or short, and then the strategy uses that to decide direction.
What is the proper way to include this? I thought something like this would work but it did not:
//user input
[NinjaScriptProperty]
[Display(Name = "Long/Short", GroupName = "Long/Short", Order = 0)]
public string LongShort { get; set; }
And then in the entry logic, include this.
For example:
bool userLong = False;
bool userShort = False;
if(LongShort == "Long")
{
userLong;
}else if(LongShort == "Short")
{
userShort;
}
protected override void OnBarUpdate()
{
if (Close[0] > Open[0] && userLong)
{
EnterLong("Enter Long");
}
if(Close[0] < Open[0] && userShort)
{
EnterShort("Enter Short");
}
}
I've lost track of how many different ways I've tried this and all of the resulting errors.
Can anyone please help point out the correct way to do this?
Edit: I'm using NT8 and Windows 10
Comment