stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Help - I can't see the wood for the trees
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5303
Page 1 of 1
Author:  RisklessPips [ Thu Oct 12, 2017 2:40 pm ]
Post subject:  Help - I can't see the wood for the trees

Code: Select all

if ((UseADX) && (!UseHGI))
{
   Alert("TRUE");
}
else
{
   Alert("FALSE");
}
This construct above is in GTWV’s breakeven processing.

A comment at the top of the function is
TradeComment = “”;
Ensuring this field is reset every pass thru.

The function then proceeds to populate the field with an appropriate comment based on signal service selected before modifying the trade AND opening a new one with this comment.

In this particular test I am doing ONLY HGI signals are switched on and the construct above gives a False alert when I test it. (As expected !)

Problem

The attached screen shot shows two comment outputs coming from processing in the True result block. The ones with ADX

I’m beating my head on the wall. How can this be ? :arrrg: :arrrg: :arrrg:

Charles
Comments.png
Edit - I was resetting the variable by TradeComment = “”; (no space between the quotes)
I have now changed it to TradeComment = “ ”; (A space in between the quotes) - is this relevant or is my brain in need of medication ?
Author:  SteveHopwood [ Thu Oct 12, 2017 4:06 pm ]
Post subject:  Help - I can't see the wood for the trees

RisklessPips » Thu Oct 12, 2017 2:40 pm wrote: Edit - I was resetting the variable by TradeComment = “”; (no space between the quotes)
I have now changed it to TradeComment = “ ”; (A space in between the quotes) - is this relevant or is my brain in need of medication ?
Truth to tell Charles, I do not understand your post.

What I can say is this: trying to send a trade with a TradeComment of "" will generate an error - cannot remember which one. A TradeComment of " " will not.

Go to OnInit() of any EA that I have ever coded with TradeComment as an input and you will see this line of code:
if(TradeComment=="") TradeComment=" ";

Not sure if this helps you Charles - merely confirming the bit of your post that I quote.

:xm:
Author:  RisklessPips [ Thu Oct 12, 2017 4:44 pm ]
Post subject:  Help - I can't see the wood for the trees

SteveHopwood » Thu Oct 12, 2017 6:06 pm wrote:
Truth to tell Charles, I do not understand your post.

What I can say is this: trying to send a trade with a TradeComment of "" will generate an error - cannot remember which one. A TradeComment of " " will not.

Go to OnInit() of any EA that I have ever coded with TradeComment as an input and you will see this line of code:
if(TradeComment=="") TradeComment=" ";

Not sure if this helps you Charles - merely confirming the bit of your post that I quote.

:xm:
Thank you Steve.

You have confirmed a suspicion i had that the incorrect comment being added to trades was caused by that ""; ( no space) assignment.

Will keep monitoring it.

Charles
All times are UTC Page 1 of 1