Login Page - Create Account

Support Board


Date/Time: Mon, 13 May 2024 13:53:38 +0000



Post From: Code Correction help (Aim is to avoid consecutive buy/sell signals)

[2019-09-02 11:43:30]
Ackin - Posts: 1865
Hi,
error is

bool dn = OpenValue > PrevHighValue;
and next !dn[sc.Index - 1]

you can't turn a bool variable into an array, variable is only one value




I hope I understand what you need...I choose the fastest and easiest way

1) create new SGs

SCSubgraphRef up = sc.Subgraph[3];
SCSubgraphRef dn = sc.Subgraph[4];

2) change rows up and dn
up[sc.Index] = OpenValue < PrevLowValue ? 1.0f : 0;
dn[sc.Index] = OpenValue > PrevHighValue ? 1.0f : 0;

3) correct condition
if ((up[sc.Index] == 1.0f)&&(dn[sc.Index-1] == 0))
{
BuyEntrySubgraph[sc.Index] = sc.Low[sc.Index];
}
// also change second condition for SELL




I'm not at the computer with c ++ right now, I'm writing it out of my head, but it should work.

Perhaps it helped you.
Date Time Of Last Edit: 2019-09-02 11:58:10