Support Board
Date/Time: Mon, 06 May 2024 21:00:31 +0000
Post From: Forward projection Bars doesn't project.
[2018-12-04 23:46:10] |
Blue Brazilian - Posts: 42 |
In studies6 and elsewhere on the Support Board, you have proposed the following code as an example of how to forward project beyond the last bar on the chart #include "sierrachart.h" #include <windows.h> #include <string> #include <stdlib.h> #include <algorithm> #include "scstudyfunctions.h" using namespace std; SCDLLName("ForwardProjectionBars2") SCSFExport scsf_ForwardProjectionBars2(SCStudyInterfaceRef sc) { SCSubgraphRef Open = sc.Subgraph[0]; SCSubgraphRef High = sc.Subgraph[1]; SCSubgraphRef Low = sc.Subgraph[2]; SCSubgraphRef Last = sc.Subgraph[3]; if (sc.SetDefaults) { // Set the configuration and defaults sc.FreeDLL = 1; sc.GraphName = "Forward Projection Bars2"; sc.AutoLoop = 1; sc.GraphRegion = 1; sc.GraphDrawType=GDT_OHLCBAR; Open.Name = "Open"; Open.DrawStyle = DRAWSTYLE_LINE; Open.PrimaryColor = RGB(0,255,0); Open.DrawZeros = false; Open.ExtendedArrayElementsToGraph= 100; High.Name = "High"; High.DrawStyle = DRAWSTYLE_LINE; High.PrimaryColor = RGB(0,255,0); High.DrawZeros = false; High.ExtendedArrayElementsToGraph= 100; Low.Name = "Low"; Low.DrawStyle = DRAWSTYLE_LINE; Low.PrimaryColor = RGB(0,255,0); Low.DrawZeros = false; Low.ExtendedArrayElementsToGraph= 100; Last.Name = "Last"; Last.DrawStyle = DRAWSTYLE_LINE; Last.PrimaryColor = RGB(0,255,0); Last.DrawZeros = false; Last.ExtendedArrayElementsToGraph= 100; return; } // Do data processing //Repeat last bar into forward projection area. if(sc.Index+1 >= sc.ArraySize) { for (int Index = sc.ArraySize ; Index < sc.ArraySize + Open.ExtendedArrayElementsToGraph ; Index++) { Open[Index] = sc.Open[sc.Index]; High[Index] = sc. High[sc.Index]; Low[Index] = sc. Low[sc.Index]; Last[Index] = sc. Close[sc.Index]; } } return; } http://www.sierrachart.com/image.php?Image=1543966669608.png |