Einzelnen Beitrag anzeigen
  #1 (permalink)  
Alt 05.05.14
tenchinhan tenchinhan ist offline
Neues Mitglied
 
Registriert seit: Feb 2014
Beiträge: 8
tenchinhan befindet sich auf einem aufstrebenden Ast
Standard Hilfe bei nachkomma Programieren

Hallo,
ich habe ein Indikator der auch super bei 5 Digits(Nachkommerstellen) funktioniert,
jetzt bin ich mit einem Standard Konto am testen wo es allerdings nur 4 nachkommastellen gibt und ich finde keine Lösung wie ich das in den Indikator einbaue bzw. verändere!
Vielleicht kann mir jemand einen tipp geben oder hat eine einfache Lösung für das Problem!
Hier der entsprechende Code:

//+------------------------------------------------------------------+
//| Linesetter |
//| By Björn Boumanns |
//+------------------------------------------------------------------+
#property copyright "Björn Boumanns"
#property link "http://Tenchinhan.de"

#property indicator_chart_window
extern int GridSpace=50;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
double shift=0;
double HighPrice=0;
double LowPrice=0;

double Divisor = 0.1/Point;

HighPrice = MathRound(High[Highest(NULL,0,2, Bars - 2, 2)] * Divisor);
//SL = High[Highest(MODE_HIGH, SLLookback, SLLookback)];
LowPrice = MathRound(Low[Lowest(NULL,0,1, Bars - 1, 2)] * Divisor);
for(shift=LowPrice;shift<=HighPrice;shift++)
{
ObjectDelete("Grid"+shift);
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
double I=0;
double HighPrice=0;
double LowPrice=0;
int GridS=0;
int SL=0;
//----

double Divisor = 0.1/Point;

HighPrice = MathRound(High[Highest(NULL,0,MODE_HIGH, Bars - 2, 2)] * Divisor);
//SL = High[Highest(MODE_HIGH, SLLookback, SLLookback)];
LowPrice = MathRound(Low[Lowest(NULL,0,MODE_LOW, Bars - 1, 2)] * Divisor);
GridS = GridSpace / 12.5;

for(I=LowPrice;I<=HighPrice;I++)
{
//Print("mod(I, GridSpace): " + MathMod(I, GridS) + " I= " + I);
//Print(LowPrice + " " + HighPrice);
if (MathMod(I, GridS) == 0)
{
if (ObjectFind("Grid"+I) != 0)
{
ObjectCreate("Grid"+I, OBJ_HLINE, 0.1, Time[1], I/Divisor);
ObjectSet("Grid"+I, OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("Grid"+I, OBJPROP_COLOR, MediumSeaOrange);
}
//MoveObject(I + "Grid", OBJ_HLINE, Time[Bars - 2], I/1000, Time[1], I/1000, MediumSeaOrange, 1, STYLE_SOLID);
}
}
//----
return(0);
}
//+------------------------------------------------------------------+




MfG
Björn