Set Variable = Pips Lost
-
HI,
i need to set the variable "Diff" with the pips lost in last trade,
my exemple:(On Tick) 1st Column Once a day Condition = [...] Sell now TP = Variable3 Modify Variables = Variable1 = Cancle, Candle 0 open 2nd Column Once per bar If Trade exists = Sell Modify Variables = Variable2 = Candle,Candle 0 open Modify Variables = (Variable List) Diff = V1-V2 (Variable1 - Variable2) Modify Variables = (Variable List) Variable4 = Variable3 + Diff Buy now TP= Variable4But whan the EA run don't see the addition " Variable3 + Diff " , in my mind i want to create a variable = price lost with last operation + my take profit (costant)...
How i can fix? -
Can you show me some project or screenshot of settings of the block where the problem happens (https://app.prntscr.com/en/index.html)?
-
Of course!
This is my project...
http://i68.tinypic.com/icpgsk.pngIn this follow image i open all "Modify Variables" and i numerate it...
http://i63.tinypic.com/j9afcx.png
http://i65.tinypic.com/3025j43.pngIn alternative i tried to replace the "Modify Variables" with a "Custom MQL4 Code"
http://i65.tinypic.com/3hmvc.pngBut the EA continues to set the "TakeProfit2" = "TakeProfit" ! Without the variable "DiffToT"
P.S: the variable "Apertura" is this:
http://i68.tinypic.com/29dh88.pngThanks for the quick response!
-
In any case there are functions like Print(), Alert() or Comment() that allows you to see any value in different way, so you can check what is going on in this block.
I don't remember problems in the "Custom MQL4 code" block in the desktop version. Now in the web version Variables are treated in different way, but in the desktop version they are direct and whatever you write in "Custom MQL4 code" should be put in the EA 1:1.
What are you trying to do actually? Isn't it possible to get the value you want from somewhere directly instead of chaining these Modify block?
-
By the way I just spotted something. In block 52 you have Diff = V7 - V5, which is this:
Diff = Apertura - Candela1OpenThen, when you replace this block with "Custom MQL4 code" you have it like this:
**Diff = Candela1Open - Apertura **By the way you can use Apertura instead of V7 if this would be easier for you. These V* things are like this so we can write shorter formulas. The other reason initially was to allow us to rename our Variables, but now when Variable is renamed, it is also renamed everywhere in the code if it was manually written. Or at least this is the case for the web version, I'm not very sure for the desktop version!
-
I resolved! Thanks for the swift response!
