Login Page - Create Account

Support Board


Date/Time: Sat, 27 Apr 2024 15:46:26 +0000



Using DMI in the CrossOver function

View Count: 1000

[2016-11-15 02:07:07]
AcquaLife - Posts: 33
I am trying to compare the negative DMI and positive DMI for a crossover. However, the crossover function takes arrays while the data in the DMI are not arrays. I tried several ways of putting the value of the pos DMI and neg DMI in two different arrays and then using the crossover function with no luck. I also followed the code example:
This is an example of looking for a crossover between the values in
// a subgraph and a fixed value. We first have to put the fixed value
// into an array. We are using one of the Subgraph internal arrays.
sc.Subgraph[2].Arrays[8][sc.Index] = 100.0;

if (sc.CrossOver(sc.Subgraph[2], sc.Subgraph[2].Arrays[8]) == CROSS_FROM_BOTTOM)
{

//Code
}
/
I though i could do what you did with the sc.Subgraph[2].Arrays[8][sc.Index] = 100.00 and replace the 100 with pos DMI and another line of code with neg DMI in array 9. Also, when i used the crossover function instead of putting both DMI pos and DMI neg as arguments, I just put one in with another known array. No matter what i do i keep getting this error: 'int s_sc::CrossOver(SCFloatArrayRef,SCFloatArrayRef,int)': cannot convert argument 1 from 'float' to 'SCFloatArrayRef'

This is the piece of code i am working with:
sc.DMI(sc.BaseDataIn, sc.Subgraph[1], 10);

  float DMIPos = sc.Subgraph[1][sc.Index];
  float DMINeg = sc.Subgraph[1].Arrays[0][sc.Index];
  
  sc.Subgraph[1].Arrays[1][sc.Index]=DMIPos;
  sc.Subgraph[1].Arrays[2][sc.Index]=DMINeg;

[2016-11-15 03:54:48]
Sierra Chart Engineering - Posts: 104368

SCSubgraphRef DIPlus = sc.Subgraph[0];
SCSubgraphRef DIMinus = sc.Subgraph[1];

sc.DMI(sc.BaseData, DIPlus, DIMinus, Length.GetInt());


if (sc.CrossOver(DIPlus.Data, DIMinus.Data) == CROSS_FROM_BOTTOM)

{

//Code

}

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-11-15 03:55:17

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account