I am trying to automate my indicator and its kicking my ass!!!! Its so frustrating because it seems so simple but I cant get it to work.
First off,
About the indicator, Its something I coded, and it draws the arrows correctly. All it does is draw an arrow when i tell it to. so, When there is a buy situation, a buy arrow goes in Buffer 0, when there is a sell situation a sell arrow goes in buffer 1. When there is no signal the buffers read 0.0000.
easy enough right? thats what i thought too but I cant get it to work right.
ALL i want it to do is, IF value is non empty in the buffer, to place the trade.
Logic.... if there is a value there, that means there is an arrow.
Once again easy....
so, I looked at Steve's HGI bot because its the same idea. If there is something in the buffer place the trade. I have tried so many different methods that I'm just beyond pissed and hence why I'm asking for help.
THE PROBLEM:
It seems to place buy and or sell trades whenever the hell it feels like it. I even create an alert for debugging to spit out the values being read, and they state 0 when a trade is placed.
I shift over 1, because the arrow paints a candle behind, never on the current candle...
The code, keep in mind i modeled the HGI code.
Code: Select all
//Indi reading code goes here
if (TrendTradingAllowed)
{
//Buffer 0 holds a buy trend arrow - large green up
val = GetKING(Symbol(), TradingTimeFrame, 0, 1);
Alert(" Buy Value = ",val);
if (!CloseEnough(val, EMPTY_VALUE) )
{
GoodToRise = True;
}//if (!CloseEnough(val 0) )
else
{
//Buffer 1 hods a sell trend arrrow - large red down
val = GetKING(Symbol(), TradingTimeFrame, 1, 1);
Alert(" Sell Value = ",val);
if (!CloseEnough(val, EMPTY_VALUE) )
{
GoodToFall = True;
}//if (!CloseEnough(val 0)
}//else
}//if (TrendTradingAllowed)
///////////////////////////////////////
//Anything else?Code: Select all
double GetKING(string symbol, int tf, int buffer, int shift)
{
return(iCustom(symbol, tf, "SLOWKING", 5, False, False, buffer, shift));
}//double GetKING()Code: Select all
bool SendLong = false, SendShort = false;
if (GoodToRise)
{
BuySignal = True;
}
//Trend Sell
if (GoodToFall)
{
SellSignal = True;
}
//Specific system filtersI just want to buy when there is an arrow(value) in buffer 0, and sell when there is an arrow(value) in buffer 1.
Thanks for any input guys.